Coverage Report

Created: 2026-09-23 12:58

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/operator/operator.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "exec/operator/operator.h"
19
20
#include <algorithm>
21
22
#include "common/status.h"
23
#include "exec/common/util.hpp"
24
#include "exec/exchange/local_exchange_sink_operator.h"
25
#include "exec/exchange/local_exchange_source_operator.h"
26
#include "exec/operator/aggregation_sink_operator.h"
27
#include "exec/operator/aggregation_source_operator.h"
28
#include "exec/operator/analytic_sink_operator.h"
29
#include "exec/operator/analytic_source_operator.h"
30
#include "exec/operator/assert_num_rows_operator.h"
31
#include "exec/operator/blackhole_sink_operator.h"
32
#include "exec/operator/bucketed_aggregation_sink_operator.h"
33
#include "exec/operator/bucketed_aggregation_source_operator.h"
34
#include "exec/operator/cache_sink_operator.h"
35
#include "exec/operator/cache_source_operator.h"
36
#include "exec/operator/datagen_operator.h"
37
#include "exec/operator/dict_sink_operator.h"
38
#include "exec/operator/distinct_streaming_aggregation_operator.h"
39
#include "exec/operator/empty_set_operator.h"
40
#include "exec/operator/exchange_sink_operator.h"
41
#include "exec/operator/exchange_source_operator.h"
42
#include "exec/operator/file_scan_operator.h"
43
#include "exec/operator/group_commit_block_sink_operator.h"
44
#include "exec/operator/group_commit_scan_operator.h"
45
#include "exec/operator/hashjoin_build_sink.h"
46
#include "exec/operator/hashjoin_probe_operator.h"
47
#include "exec/operator/hive_table_sink_operator.h"
48
#include "exec/operator/iceberg_delete_sink_operator.h"
49
#include "exec/operator/iceberg_merge_sink_operator.h"
50
#include "exec/operator/iceberg_table_sink_operator.h"
51
#include "exec/operator/jdbc_scan_operator.h"
52
#include "exec/operator/jdbc_table_sink_operator.h"
53
#include "exec/operator/local_merge_sort_source_operator.h"
54
#include "exec/operator/materialization_opertor.h"
55
#include "exec/operator/maxcompute_table_sink_operator.h"
56
#include "exec/operator/memory_scratch_sink_operator.h"
57
#include "exec/operator/meta_scan_operator.h"
58
#include "exec/operator/mock_operator.h"
59
#include "exec/operator/mock_scan_operator.h"
60
#include "exec/operator/multi_cast_data_stream_sink.h"
61
#include "exec/operator/multi_cast_data_stream_source.h"
62
#include "exec/operator/nested_loop_join_build_operator.h"
63
#include "exec/operator/nested_loop_join_probe_operator.h"
64
#include "exec/operator/olap_scan_operator.h"
65
#include "exec/operator/olap_table_sink_operator.h"
66
#include "exec/operator/olap_table_sink_v2_operator.h"
67
#include "exec/operator/partition_sort_sink_operator.h"
68
#include "exec/operator/partition_sort_source_operator.h"
69
#include "exec/operator/partitioned_aggregation_sink_operator.h"
70
#include "exec/operator/partitioned_aggregation_source_operator.h"
71
#include "exec/operator/partitioned_hash_join_probe_operator.h"
72
#include "exec/operator/partitioned_hash_join_sink_operator.h"
73
#include "exec/operator/rec_cte_anchor_sink_operator.h"
74
#include "exec/operator/rec_cte_scan_operator.h"
75
#include "exec/operator/rec_cte_sink_operator.h"
76
#include "exec/operator/rec_cte_source_operator.h"
77
#include "exec/operator/repeat_operator.h"
78
#include "exec/operator/result_file_sink_operator.h"
79
#include "exec/operator/result_sink_operator.h"
80
#include "exec/operator/schema_scan_operator.h"
81
#include "exec/operator/select_operator.h"
82
#include "exec/operator/set_probe_sink_operator.h"
83
#include "exec/operator/set_sink_operator.h"
84
#include "exec/operator/set_source_operator.h"
85
#include "exec/operator/sort_sink_operator.h"
86
#include "exec/operator/sort_source_operator.h"
87
#include "exec/operator/spill_iceberg_table_sink_operator.h"
88
#include "exec/operator/spill_sort_sink_operator.h"
89
#include "exec/operator/spill_sort_source_operator.h"
90
#include "exec/operator/streaming_aggregation_operator.h"
91
#include "exec/operator/table_function_operator.h"
92
#include "exec/operator/tvf_table_sink_operator.h"
93
#include "exec/operator/union_sink_operator.h"
94
#include "exec/operator/union_source_operator.h"
95
#include "exec/pipeline/dependency.h"
96
#include "exec/pipeline/pipeline.h"
97
#include "exprs/vexpr.h"
98
#include "exprs/vexpr_context.h"
99
#include "runtime/runtime_profile.h"
100
#include "runtime/runtime_profile_counter_names.h"
101
#include "util/debug_util.h"
102
#include "util/string_util.h"
103
104
namespace doris {
105
class RowDescriptor;
106
class RuntimeState;
107
} // namespace doris
108
109
namespace doris {
110
111
0
Status OperatorBase::close(RuntimeState* state) {
112
0
    if (_is_closed) {
113
0
        return Status::OK();
114
0
    }
115
0
    _is_closed = true;
116
0
    return Status::OK();
117
0
}
118
119
template <typename SharedStateArg>
120
1.65M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.65M
    if (_parent->nereids_id() == -1) {
122
859k
        return fmt::format("(id={})", _parent->node_id());
123
859k
    } else {
124
797k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
797k
    }
126
1.65M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
74.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
74.6k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
74.6k
    } else {
124
74.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
74.6k
    }
126
74.6k
}
_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
211k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
211k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
211k
    } else {
124
211k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
211k
    }
126
211k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
27
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
27
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
27
    } else {
124
27
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
27
    }
126
27
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.00k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.00k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
6.00k
    } else {
124
6.00k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.00k
    }
126
6.00k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.61k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.61k
    if (_parent->nereids_id() == -1) {
122
14
        return fmt::format("(id={})", _parent->node_id());
123
8.60k
    } else {
124
8.60k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.60k
    }
126
8.61k
}
_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
73.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
73.0k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
73.0k
    } else {
124
73.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
73.0k
    }
126
73.0k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
38
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
38
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
38
    } else {
124
38
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
38
    }
126
38
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
531k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
531k
    if (_parent->nereids_id() == -1) {
122
259k
        return fmt::format("(id={})", _parent->node_id());
123
272k
    } else {
124
272k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
272k
    }
126
531k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
55.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
55.0k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
55.0k
    } else {
124
55.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
55.0k
    }
126
55.0k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
24
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        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
24
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.27k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.27k
    if (_parent->nereids_id() == -1) {
122
5.27k
        return fmt::format("(id={})", _parent->node_id());
123
5.27k
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
5.27k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
351
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
351
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
249
    } else {
124
249
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
249
    }
126
351
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.19k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.19k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.18k
    } else {
124
5.18k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.18k
    }
126
5.19k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
594k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
595k
    if (_parent->nereids_id() == -1) {
122
595k
        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
594k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
169
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
169
    } else {
124
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
169
    }
126
169
}
127
128
template <typename SharedStateArg>
129
1.15M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.15M
    if (_parent->nereids_id() == -1) {
131
630k
        return fmt::format("(id={})", _parent->node_id());
132
630k
    } else {
133
525k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
525k
    }
135
1.15M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
122k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
122k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
122k
    } else {
133
122k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
122k
    }
135
122k
}
_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
214k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
214k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
214k
    } else {
133
214k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
214k
    }
135
214k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
34
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
34
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
34
    } else {
133
34
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
34
    }
135
34
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
6.02k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6.02k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
6.02k
    } else {
133
6.02k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
6.02k
    }
135
6.02k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.65k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.65k
    if (_parent->nereids_id() == -1) {
131
14
        return fmt::format("(id={})", _parent->node_id());
132
8.64k
    } else {
133
8.64k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.64k
    }
135
8.65k
}
_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
72.6k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
72.6k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
72.6k
    } else {
133
72.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
72.6k
    }
135
72.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
48
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
48
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
48
    } else {
133
48
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
48
    }
135
48
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
24
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
24
    if (_parent->nereids_id() == -1) {
131
24
        return fmt::format("(id={})", _parent->node_id());
132
24
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
24
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9.96k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9.96k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
9.95k
    } else {
133
9.95k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
9.95k
    }
135
9.96k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
353
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
353
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
251
    } else {
133
251
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
251
    }
135
353
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
13.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
13.1k
    if (_parent->nereids_id() == -1) {
131
13.1k
        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
13.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
222k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
222k
    if (_parent->nereids_id() == -1) {
131
222k
        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
222k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
394k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
394k
    if (_parent->nereids_id() == -1) {
131
394k
        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
394k
}
_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
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
338
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
338
    } else {
133
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
338
    }
135
338
}
136
137
template <typename SharedStateArg>
138
30.8k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
30.8k
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
30.8k
    _terminated = true;
143
30.8k
    return Status::OK();
144
30.8k
}
_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
3.30k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3.30k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3.30k
    _terminated = true;
143
3.30k
    return Status::OK();
144
3.30k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_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_19AnalyticSharedStateEE9terminateEPNS_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_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.48k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.48k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.48k
    _terminated = true;
143
1.48k
    return Status::OK();
144
1.48k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
767
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
767
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
767
    _terminated = true;
143
767
    return Status::OK();
144
767
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
574
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
574
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
573
    _terminated = true;
143
573
    return Status::OK();
144
574
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
158
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
158
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
158
    _terminated = true;
143
158
    return Status::OK();
144
158
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
6
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
6
    _terminated = true;
143
6
    return Status::OK();
144
6
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
127
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
127
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
127
    _terminated = true;
143
127
    return Status::OK();
144
127
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
13
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
13
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
13
    _terminated = true;
143
13
    return Status::OK();
144
13
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
249
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
249
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
249
    _terminated = true;
143
249
    return Status::OK();
144
249
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
135
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
135
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
135
    _terminated = true;
143
135
    return Status::OK();
144
135
}
145
146
304k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
304k
    return _child && _child->is_serial_operator() && !is_source()
148
304k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
304k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
304k
}
151
152
26.8k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
26.8k
    if (!_child) {
154
25.8k
        return false;
155
25.8k
    }
156
1.01k
    if (_child->is_serial_operator()) {
157
114
        return true;
158
114
    }
159
900
    const auto child_distribution = _child->required_data_distribution(state);
160
900
    return child_distribution.need_local_exchange() &&
161
900
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.01k
}
163
164
template <typename SharedStateArg>
165
16.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.6k
    fmt::memory_buffer debug_string_buffer;
167
16.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.6k
    return fmt::to_string(debug_string_buffer);
169
16.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
16.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.6k
    fmt::memory_buffer debug_string_buffer;
167
16.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.6k
    return fmt::to_string(debug_string_buffer);
169
16.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
16.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.6k
    fmt::memory_buffer debug_string_buffer;
174
16.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.6k
    return fmt::to_string(debug_string_buffer);
176
16.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
16.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.6k
    fmt::memory_buffer debug_string_buffer;
174
16.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.6k
    return fmt::to_string(debug_string_buffer);
176
16.6k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
16.6k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
16.6k
    fmt::memory_buffer debug_string_buffer;
180
16.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
16.6k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
16.6k
                   _is_serial_operator);
183
16.6k
    return fmt::to_string(debug_string_buffer);
184
16.6k
}
185
186
16.6k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
16.6k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
16.6k
}
189
190
651k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
651k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
651k
    _nereids_id = tnode.nereids_id;
193
651k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.87k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.87k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.87k
            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.87k
    }
206
651k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
651k
    _op_name = substr + "_OPERATOR";
208
209
651k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
651k
    } else if (tnode.__isset.conjuncts) {
212
272k
        for (const auto& conjunct : tnode.conjuncts) {
213
272k
            VExprContextSPtr context;
214
272k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
272k
            _conjuncts.emplace_back(context);
216
272k
        }
217
99.1k
    }
218
219
    // create the projections expr
220
651k
    if (tnode.__isset.projections) {
221
259k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
259k
    }
223
651k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.87k
        DCHECK(has_projection()) << "no final projections";
225
3.87k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.49k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.49k
            VExprContextSPtrs projections;
228
6.49k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.49k
            _projection->intermediate_projections.push_back(projections);
230
6.49k
        }
231
3.87k
    }
232
651k
    return Status::OK();
233
651k
}
234
235
678k
Status OperatorXBase::prepare(RuntimeState* state) {
236
678k
    for (auto& conjunct : _conjuncts) {
237
272k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
272k
    }
239
678k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
628k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
337k
            return a->execute_cost() < b->execute_cost();
242
337k
        });
243
628k
    };
244
245
678k
    if (has_projection()) {
246
259k
        auto& projection = *_projection;
247
265k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.49k
            const auto& input_row_desc =
249
6.49k
                    i == 0 ? operator_row_desc_before_projection()
250
6.49k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.49k
            RETURN_IF_ERROR(
252
6.49k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.49k
        }
254
259k
        const auto& final_projection_input_row_desc =
255
259k
                projection.intermediate_output_row_descriptors.empty()
256
259k
                        ? operator_row_desc_before_projection()
257
259k
                        : projection.intermediate_output_row_descriptors.back();
258
259k
        RETURN_IF_ERROR(
259
259k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
259k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
259k
                                                      projection.output_row_descriptor));
262
259k
    }
263
264
678k
    for (auto& conjunct : _conjuncts) {
265
272k
        RETURN_IF_ERROR(conjunct->open(state));
266
272k
    }
267
678k
    if (has_projection()) {
268
259k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
259k
        for (auto& projections : _projection->intermediate_projections) {
270
6.49k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.49k
        }
272
259k
    }
273
678k
    if (_child && !is_source()) {
274
93.9k
        RETURN_IF_ERROR(_child->prepare(state));
275
93.9k
    }
276
277
678k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
678k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
678k
    return Status::OK();
283
678k
}
284
285
7.47k
Status OperatorXBase::terminate(RuntimeState* state) {
286
7.47k
    if (_child && !is_source()) {
287
625
        RETURN_IF_ERROR(_child->terminate(state));
288
625
    }
289
7.47k
    auto result = state->get_local_state_result(operator_id());
290
7.47k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
7.47k
    return result.value()->terminate(state);
294
7.47k
}
295
296
4.45M
Status OperatorXBase::close(RuntimeState* state) {
297
4.45M
    if (_child && !is_source()) {
298
686k
        RETURN_IF_ERROR(_child->close(state));
299
686k
    }
300
4.45M
    auto result = state->get_local_state_result(operator_id());
301
4.45M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.45M
    return result.value()->close(state);
305
4.45M
}
306
307
280k
void PipelineXLocalStateBase::clear_origin_block() {
308
280k
    _origin_block.clear_column_data(
309
280k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
280k
}
311
312
692k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
692k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
692k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
692k
    return Status::OK();
317
692k
}
318
319
0
bool PipelineXLocalStateBase::is_blockable() const {
320
0
    return std::any_of(_projections.begin(), _projections.end(),
321
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
322
0
}
323
324
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
325
280k
                                     Block* output_block) const {
326
280k
    auto* local_state = state->get_local_state(operator_id());
327
280k
    SCOPED_TIMER(local_state->exec_time_counter());
328
280k
    SCOPED_TIMER(local_state->_projection_timer);
329
280k
    const size_t rows = origin_block->rows();
330
280k
    if (rows == 0) {
331
149k
        return Status::OK();
332
149k
    }
333
130k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
130k
    {
336
130k
        Block input_block = *origin_block;
337
338
130k
        ColumnsWithTypeAndName new_columns;
339
130k
        for (const auto& projections : local_state->_intermediate_projections) {
340
4.09k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
4.09k
            new_columns.resize(projections.size());
345
74.7k
            for (int i = 0; i < projections.size(); i++) {
346
70.6k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
70.6k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
70.6k
            }
355
4.08k
            Block tmp_block {new_columns};
356
4.08k
            input_block.swap(tmp_block);
357
4.08k
        }
358
359
130k
        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
130k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
130k
                output_block, _projection->output_row_descriptor);
368
130k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
130k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
130k
        Columns shared_columns(mutable_columns.size());
371
372
750k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
620k
            ColumnPtr column_ptr;
374
620k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
620k
            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
620k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
620k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
620k
            if (column_ptr->is_exclusive()) {
386
226k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
393k
            } else {
388
393k
                shared_columns[i] = std::move(column_ptr);
389
393k
            }
390
620k
        }
391
392
130k
        scoped_mutable_block.restore();
393
750k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
620k
            if (shared_columns[i]) {
395
393k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
393k
            }
397
620k
        }
398
130k
    }
399
400
0
    origin_block->clear_column_data(
401
130k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
130k
    DCHECK_EQ(output_block->rows(), rows);
403
404
130k
    return Status::OK();
405
130k
}
406
407
3.98M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
3.98M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
3.98M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
3.98M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
3.98M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
3.98M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
3.98M
            if (_debug_point_count++ % 2 == 0) {
414
3.98M
                return Status::OK();
415
3.98M
            }
416
3.98M
        }
417
3.98M
    });
418
419
3.98M
    Status status;
420
3.98M
    auto* local_state = state->get_local_state(operator_id());
421
3.98M
    Defer defer([&]() {
422
3.98M
        if (status.ok()) {
423
3.98M
            local_state->update_output_block_counters(*block);
424
3.98M
        }
425
3.97M
    });
426
3.98M
    if (has_projection()) {
427
280k
        local_state->clear_origin_block();
428
280k
        status = get_block(state, &local_state->_origin_block, eos);
429
280k
        if (UNLIKELY(!status.ok())) {
430
25
            return status;
431
25
        }
432
280k
        status = do_projections(state, &local_state->_origin_block, block);
433
280k
        return status;
434
280k
    }
435
3.70M
    status = get_block(state, block, eos);
436
3.70M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.70M
    return status;
438
3.70M
}
439
440
2.60M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.60M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.50k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.50k
        *eos = true;
444
9.50k
    }
445
446
2.60M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.60M
        auto op_name = to_lower(_parent->_op_name);
448
2.60M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.60M
        arg_op_name = to_lower(arg_op_name);
450
451
2.60M
        if (op_name == arg_op_name) {
452
2.60M
            *eos = true;
453
2.60M
        }
454
2.60M
    });
455
456
2.60M
    if (auto rows = block->rows()) {
457
715k
        _num_rows_returned += rows;
458
715k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
715k
    }
460
2.60M
}
461
462
30.8k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
30.8k
    auto result = state->get_sink_local_state_result();
464
30.8k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
30.8k
    return result.value()->terminate(state);
468
30.8k
}
469
470
16.6k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
16.6k
    fmt::memory_buffer debug_string_buffer;
472
473
16.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
16.6k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
16.6k
    return fmt::to_string(debug_string_buffer);
476
16.6k
}
477
478
16.6k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
16.6k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
16.6k
}
481
482
338k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
338k
    std::string op_name = "UNKNOWN_SINK";
484
338k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
339k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
339k
        op_name = it->second;
488
339k
    }
489
338k
    _name = op_name + "_OPERATOR";
490
338k
    return Status::OK();
491
338k
}
492
493
292k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
292k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
292k
    _nereids_id = tnode.nereids_id;
496
292k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
292k
    _name = substr + "_SINK_OPERATOR";
498
292k
    return Status::OK();
499
292k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.64M
                                                            LocalSinkStateInfo& info) {
504
1.64M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.64M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.64M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.64M
    return Status::OK();
508
1.64M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
122k
                                                            LocalSinkStateInfo& info) {
504
122k
    auto local_state = LocalStateType::create_unique(this, state);
505
122k
    RETURN_IF_ERROR(local_state->init(state, info));
506
122k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
122k
    return Status::OK();
508
122k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
346k
                                                            LocalSinkStateInfo& info) {
504
346k
    auto local_state = LocalStateType::create_unique(this, state);
505
346k
    RETURN_IF_ERROR(local_state->init(state, info));
506
346k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
346k
    return Status::OK();
508
346k
}
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
379
                                                            LocalSinkStateInfo& info) {
504
379
    auto local_state = LocalStateType::create_unique(this, state);
505
379
    RETURN_IF_ERROR(local_state->init(state, info));
506
379
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
379
    return Status::OK();
508
379
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
48.5k
                                                            LocalSinkStateInfo& info) {
504
48.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
48.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
48.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
48.5k
    return Status::OK();
508
48.5k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8
                                                            LocalSinkStateInfo& info) {
504
8
    auto local_state = LocalStateType::create_unique(this, state);
505
8
    RETURN_IF_ERROR(local_state->init(state, info));
506
8
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8
    return Status::OK();
508
8
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.66k
                                                            LocalSinkStateInfo& info) {
504
8.66k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.66k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.66k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.66k
    return Status::OK();
508
8.66k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
21
                                                            LocalSinkStateInfo& info) {
504
21
    auto local_state = LocalStateType::create_unique(this, state);
505
21
    RETURN_IF_ERROR(local_state->init(state, info));
506
21
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
21
    return Status::OK();
508
21
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
214k
                                                            LocalSinkStateInfo& info) {
504
214k
    auto local_state = LocalStateType::create_unique(this, state);
505
214k
    RETURN_IF_ERROR(local_state->init(state, info));
506
214k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
214k
    return Status::OK();
508
214k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
34
                                                            LocalSinkStateInfo& info) {
504
34
    auto local_state = LocalStateType::create_unique(this, state);
505
34
    RETURN_IF_ERROR(local_state->init(state, info));
506
34
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
34
    return Status::OK();
508
34
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
222k
                                                            LocalSinkStateInfo& info) {
504
222k
    auto local_state = LocalStateType::create_unique(this, state);
505
222k
    RETURN_IF_ERROR(local_state->init(state, info));
506
222k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
222k
    return Status::OK();
508
222k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
91.2k
                                                            LocalSinkStateInfo& info) {
504
91.2k
    auto local_state = LocalStateType::create_unique(this, state);
505
91.2k
    RETURN_IF_ERROR(local_state->init(state, info));
506
91.2k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
91.2k
    return Status::OK();
508
91.2k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
72.7k
                                                            LocalSinkStateInfo& info) {
504
72.7k
    auto local_state = LocalStateType::create_unique(this, state);
505
72.7k
    RETURN_IF_ERROR(local_state->init(state, info));
506
72.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
72.7k
    return Status::OK();
508
72.7k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_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_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
480k
                                                            LocalSinkStateInfo& info) {
504
480k
    auto local_state = LocalStateType::create_unique(this, state);
505
480k
    RETURN_IF_ERROR(local_state->init(state, info));
506
480k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
480k
    return Status::OK();
508
480k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.03k
                                                            LocalSinkStateInfo& info) {
504
6.03k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.03k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.03k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.03k
    return Status::OK();
508
6.03k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
9.97k
                                                            LocalSinkStateInfo& info) {
504
9.97k
    auto local_state = LocalStateType::create_unique(this, state);
505
9.97k
    RETURN_IF_ERROR(local_state->init(state, info));
506
9.97k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9.97k
    return Status::OK();
508
9.97k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.17k
                                                            LocalSinkStateInfo& info) {
504
2.17k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.17k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.17k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.17k
    return Status::OK();
508
2.17k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
251
                                                            LocalSinkStateInfo& info) {
504
251
    auto local_state = LocalStateType::create_unique(this, state);
505
251
    RETURN_IF_ERROR(local_state->init(state, info));
506
251
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
251
    return Status::OK();
508
251
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.97k
                                                            LocalSinkStateInfo& info) {
504
4.97k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.97k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.97k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.97k
    return Status::OK();
508
4.97k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.77k
                                                            LocalSinkStateInfo& info) {
504
2.77k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.77k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.77k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.77k
    return Status::OK();
508
2.77k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.67k
                                                            LocalSinkStateInfo& info) {
504
2.67k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.67k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.67k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.67k
    return Status::OK();
508
2.67k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.56k
                                                            LocalSinkStateInfo& info) {
504
2.56k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.56k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.56k
    return Status::OK();
508
2.56k
}
_ZN5doris17DataSinkOperatorXINS_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
567
                                                            LocalSinkStateInfo& info) {
504
567
    auto local_state = LocalStateType::create_unique(this, state);
505
567
    RETURN_IF_ERROR(local_state->init(state, info));
506
567
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
567
    return Status::OK();
508
567
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
105
                                                            LocalSinkStateInfo& info) {
504
105
    auto local_state = LocalStateType::create_unique(this, state);
505
105
    RETURN_IF_ERROR(local_state->init(state, info));
506
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
105
    return Status::OK();
508
105
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
509
510
template <typename LocalStateType>
511
1.31M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
0
                                 LocalExchangeSharedState>) {
514
0
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
0
                                        MultiCastSharedState>) {
517
0
        throw Exception(Status::FatalError("should not reach here!"));
518
1.31M
    } else {
519
1.31M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.31M
        ss->id = operator_id();
521
1.31M
        for (auto& dest : dests_id()) {
522
1.30M
            ss->related_op_ids.insert(dest);
523
1.30M
        }
524
1.31M
        return ss;
525
1.31M
    }
526
1.31M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
106k
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
106k
    } else {
519
106k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
106k
        ss->id = operator_id();
521
106k
        for (auto& dest : dests_id()) {
522
106k
            ss->related_op_ids.insert(dest);
523
106k
        }
524
106k
        return ss;
525
106k
    }
526
106k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
346k
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
346k
    } else {
519
346k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
346k
        ss->id = operator_id();
521
346k
        for (auto& dest : dests_id()) {
522
344k
            ss->related_op_ids.insert(dest);
523
344k
        }
524
346k
        return ss;
525
346k
    }
526
346k
}
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
378
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
378
    } else {
519
378
        auto ss = LocalStateType::SharedStateType::create_shared();
520
378
        ss->id = operator_id();
521
379
        for (auto& dest : dests_id()) {
522
379
            ss->related_op_ids.insert(dest);
523
379
        }
524
378
        return ss;
525
378
    }
526
378
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
48.6k
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.6k
    } else {
519
48.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
48.6k
        ss->id = operator_id();
521
48.6k
        for (auto& dest : dests_id()) {
522
48.2k
            ss->related_op_ids.insert(dest);
523
48.2k
        }
524
48.6k
        return ss;
525
48.6k
    }
526
48.6k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
8
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
    } else {
519
8
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8
        ss->id = operator_id();
521
8
        for (auto& dest : dests_id()) {
522
8
            ss->related_op_ids.insert(dest);
523
8
        }
524
8
        return ss;
525
8
    }
526
8
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
8.69k
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.69k
    } else {
519
8.69k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.69k
        ss->id = operator_id();
521
8.69k
        for (auto& dest : dests_id()) {
522
8.69k
            ss->related_op_ids.insert(dest);
523
8.69k
        }
524
8.69k
        return ss;
525
8.69k
    }
526
8.69k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
21
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
21
    } else {
519
21
        auto ss = LocalStateType::SharedStateType::create_shared();
520
21
        ss->id = operator_id();
521
21
        for (auto& dest : dests_id()) {
522
21
            ss->related_op_ids.insert(dest);
523
21
        }
524
21
        return ss;
525
21
    }
526
21
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
215k
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
215k
    } else {
519
215k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
215k
        ss->id = operator_id();
521
215k
        for (auto& dest : dests_id()) {
522
215k
            ss->related_op_ids.insert(dest);
523
215k
        }
524
215k
        return ss;
525
215k
    }
526
215k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
36
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
36
    } else {
519
36
        auto ss = LocalStateType::SharedStateType::create_shared();
520
36
        ss->id = operator_id();
521
36
        for (auto& dest : dests_id()) {
522
36
            ss->related_op_ids.insert(dest);
523
36
        }
524
36
        return ss;
525
36
    }
526
36
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
91.6k
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
91.6k
    } else {
519
91.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
91.6k
        ss->id = operator_id();
521
91.6k
        for (auto& dest : dests_id()) {
522
91.6k
            ss->related_op_ids.insert(dest);
523
91.6k
        }
524
91.6k
        return ss;
525
91.6k
    }
526
91.6k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
47
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
47
    } else {
519
47
        auto ss = LocalStateType::SharedStateType::create_shared();
520
47
        ss->id = operator_id();
521
47
        for (auto& dest : dests_id()) {
522
47
            ss->related_op_ids.insert(dest);
523
47
        }
524
47
        return ss;
525
47
    }
526
47
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
481k
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
481k
    } else {
519
481k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
481k
        ss->id = operator_id();
521
481k
        for (auto& dest : dests_id()) {
522
478k
            ss->related_op_ids.insert(dest);
523
478k
        }
524
481k
        return ss;
525
481k
    }
526
481k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.04k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6.04k
    } else {
519
6.04k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.04k
        ss->id = operator_id();
521
6.04k
        for (auto& dest : dests_id()) {
522
6.02k
            ss->related_op_ids.insert(dest);
523
6.02k
        }
524
6.04k
        return ss;
525
6.04k
    }
526
6.04k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
352
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
352
    } else {
519
352
        auto ss = LocalStateType::SharedStateType::create_shared();
520
352
        ss->id = operator_id();
521
353
        for (auto& dest : dests_id()) {
522
353
            ss->related_op_ids.insert(dest);
523
353
        }
524
352
        return ss;
525
352
    }
526
352
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.68k
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.68k
    } else {
519
2.68k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.68k
        ss->id = operator_id();
521
2.68k
        for (auto& dest : dests_id()) {
522
2.68k
            ss->related_op_ids.insert(dest);
523
2.68k
        }
524
2.68k
        return ss;
525
2.68k
    }
526
2.68k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.58k
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.58k
    } else {
519
2.58k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.58k
        ss->id = operator_id();
521
2.58k
        for (auto& dest : dests_id()) {
522
2.58k
            ss->related_op_ids.insert(dest);
523
2.58k
        }
524
2.58k
        return ss;
525
2.58k
    }
526
2.58k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
562
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
562
    } else {
519
562
        auto ss = LocalStateType::SharedStateType::create_shared();
520
562
        ss->id = operator_id();
521
562
        for (auto& dest : dests_id()) {
522
562
            ss->related_op_ids.insert(dest);
523
562
        }
524
562
        return ss;
525
562
    }
526
562
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
105
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
105
    } else {
519
105
        auto ss = LocalStateType::SharedStateType::create_shared();
520
105
        ss->id = operator_id();
521
105
        for (auto& dest : dests_id()) {
522
105
            ss->related_op_ids.insert(dest);
523
105
        }
524
105
        return ss;
525
105
    }
526
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.90M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.90M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.90M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.90M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.90M
    return Status::OK();
534
1.90M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
74.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
74.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
74.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
74.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
74.8k
    return Status::OK();
534
74.8k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
237k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
237k
    auto local_state = LocalStateType::create_unique(state, this);
531
237k
    RETURN_IF_ERROR(local_state->init(state, info));
532
237k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
237k
    return Status::OK();
534
237k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
124
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
124
    auto local_state = LocalStateType::create_unique(state, this);
531
124
    RETURN_IF_ERROR(local_state->init(state, info));
532
124
    state->emplace_local_state(operator_id(), std::move(local_state));
533
124
    return Status::OK();
534
124
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.61k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.61k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.61k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.61k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.61k
    return Status::OK();
534
8.61k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.50k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.50k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.50k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.50k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.50k
    return Status::OK();
534
8.50k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_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_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
205k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
205k
    auto local_state = LocalStateType::create_unique(state, this);
531
205k
    RETURN_IF_ERROR(local_state->init(state, info));
532
205k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
205k
    return Status::OK();
534
205k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
91.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
91.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
91.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
91.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
91.1k
    return Status::OK();
534
91.1k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
73.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
73.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
73.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
73.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
73.1k
    return Status::OK();
534
73.1k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
38
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
38
    auto local_state = LocalStateType::create_unique(state, this);
531
38
    RETURN_IF_ERROR(local_state->init(state, info));
532
38
    state->emplace_local_state(operator_id(), std::move(local_state));
533
38
    return Status::OK();
534
38
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.00k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.00k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.00k
    return Status::OK();
534
4.00k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
259k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
259k
    auto local_state = LocalStateType::create_unique(state, this);
531
259k
    RETURN_IF_ERROR(local_state->init(state, info));
532
259k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
259k
    return Status::OK();
534
259k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.46k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.46k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.46k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.46k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.46k
    return Status::OK();
534
1.46k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.00k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.00k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.00k
    return Status::OK();
534
6.00k
}
_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
55.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
55.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
55.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
55.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
55.0k
    return Status::OK();
534
55.0k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.27k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.27k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.27k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.27k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.27k
    return Status::OK();
534
5.27k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
249
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
249
    auto local_state = LocalStateType::create_unique(state, this);
531
249
    RETURN_IF_ERROR(local_state->init(state, info));
532
249
    state->emplace_local_state(operator_id(), std::move(local_state));
533
249
    return Status::OK();
534
249
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.67k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.67k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.67k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.67k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.67k
    return Status::OK();
534
2.67k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.54k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.54k
    return Status::OK();
534
2.54k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
374
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
374
    auto local_state = LocalStateType::create_unique(state, this);
531
374
    RETURN_IF_ERROR(local_state->init(state, info));
532
374
    state->emplace_local_state(operator_id(), std::move(local_state));
533
374
    return Status::OK();
534
374
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.68k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.68k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.68k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.68k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.68k
    return Status::OK();
534
1.68k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.3k
    return Status::OK();
534
10.3k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
599k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
599k
    auto local_state = LocalStateType::create_unique(state, this);
531
599k
    RETURN_IF_ERROR(local_state->init(state, info));
532
599k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
599k
    return Status::OK();
534
599k
}
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
169
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
169
    auto local_state = LocalStateType::create_unique(state, this);
531
169
    RETURN_IF_ERROR(local_state->init(state, info));
532
169
    state->emplace_local_state(operator_id(), std::move(local_state));
533
169
    return Status::OK();
534
169
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.20k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.20k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.20k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.20k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.20k
    return Status::OK();
534
2.20k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
792
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
792
    auto local_state = LocalStateType::create_unique(state, this);
531
792
    RETURN_IF_ERROR(local_state->init(state, info));
532
792
    state->emplace_local_state(operator_id(), std::move(local_state));
533
792
    return Status::OK();
534
792
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.11k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.11k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.11k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.11k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.11k
    return Status::OK();
534
1.11k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.28k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.28k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.28k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.28k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.28k
    return Status::OK();
534
7.28k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
243k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
243k
    auto local_state = LocalStateType::create_unique(state, this);
531
243k
    RETURN_IF_ERROR(local_state->init(state, info));
532
243k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
243k
    return Status::OK();
534
243k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.63M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.89M
        : _num_rows_returned(0),
542
1.89M
          _rows_returned_counter(nullptr),
543
1.89M
          _parent(parent),
544
1.89M
          _state(state),
545
1.89M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.91M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.91M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.91M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.91M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.91M
    _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.91M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.91M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.91M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.91M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.91M
    if constexpr (!is_fake_shared) {
560
1.13M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
683k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
683k
                                    .first.get()
563
683k
                                    ->template cast<SharedStateArg>();
564
565
683k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
683k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
683k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
683k
        } else if (info.shared_state) {
569
384k
            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
384k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
384k
            _dependency = _shared_state->create_source_dependency(
576
384k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
384k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
384k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
384k
        } else {
580
70.8k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
9.57k
                DCHECK(false);
582
9.57k
            }
583
70.8k
        }
584
1.13M
    }
585
586
1.91M
    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.91M
    _rows_returned_counter =
591
1.91M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.91M
    _blocks_returned_counter =
593
1.91M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.91M
    _output_block_bytes_counter =
595
1.91M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.91M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.91M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.91M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.91M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.91M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.91M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.91M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.91M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.91M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.91M
    _memory_used_counter =
606
1.91M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.91M
    _common_profile->add_info_string("IsColocate",
608
1.91M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.91M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.91M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.91M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.91M
    return Status::OK();
613
1.91M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
75.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
75.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
75.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
75.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
75.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
75.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
75.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
75.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
75.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
75.0k
    if constexpr (!is_fake_shared) {
560
75.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
16.4k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
16.4k
                                    .first.get()
563
16.4k
                                    ->template cast<SharedStateArg>();
564
565
16.4k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
16.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
16.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
58.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
57.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
57.9k
            _dependency = _shared_state->create_source_dependency(
576
57.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
57.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
57.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
57.9k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
655
        }
584
75.0k
    }
585
586
75.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
75.0k
    _rows_returned_counter =
591
75.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
75.0k
    _blocks_returned_counter =
593
75.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
75.0k
    _output_block_bytes_counter =
595
75.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
75.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
75.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
75.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
75.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
75.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
75.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
75.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
75.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
75.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
75.0k
    _memory_used_counter =
606
75.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
75.0k
    _common_profile->add_info_string("IsColocate",
608
75.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
75.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
75.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
75.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
75.0k
    return Status::OK();
613
75.0k
}
_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
214k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
214k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
214k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
214k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
214k
    _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
214k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
214k
    _operator_profile->add_child(_common_profile.get(), true);
557
214k
    _operator_profile->add_child(_custom_profile.get(), true);
558
214k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
214k
    if constexpr (!is_fake_shared) {
560
214k
        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
214k
        } 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
206k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
206k
            _dependency = _shared_state->create_source_dependency(
576
206k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
206k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
206k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
206k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
7.93k
        }
584
214k
    }
585
586
214k
    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
214k
    _rows_returned_counter =
591
214k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
214k
    _blocks_returned_counter =
593
214k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
214k
    _output_block_bytes_counter =
595
214k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
214k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
214k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
214k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
214k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
214k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
214k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
214k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
214k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
214k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
214k
    _memory_used_counter =
606
214k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
214k
    _common_profile->add_info_string("IsColocate",
608
214k
                                     std::to_string(_parent->is_colocated_operator()));
609
214k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
214k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
214k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
214k
    return Status::OK();
613
214k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
27
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
27
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
27
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
27
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
27
    _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
27
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
27
    _operator_profile->add_child(_common_profile.get(), true);
557
27
    _operator_profile->add_child(_custom_profile.get(), true);
558
27
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
27
    if constexpr (!is_fake_shared) {
560
27
        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
27
        } 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
27
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
27
            _dependency = _shared_state->create_source_dependency(
576
27
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
27
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
27
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
27
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
27
    }
585
586
27
    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
27
    _rows_returned_counter =
591
27
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
27
    _blocks_returned_counter =
593
27
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
27
    _output_block_bytes_counter =
595
27
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
27
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
27
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
27
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
27
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
27
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
27
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
27
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
27
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
27
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
27
    _memory_used_counter =
606
27
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
27
    _common_profile->add_info_string("IsColocate",
608
27
                                     std::to_string(_parent->is_colocated_operator()));
609
27
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
27
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
27
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
27
    return Status::OK();
613
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.01k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.01k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.01k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.01k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.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
6.01k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.01k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.01k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.01k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.01k
    if constexpr (!is_fake_shared) {
560
6.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
6.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
5.97k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.97k
            _dependency = _shared_state->create_source_dependency(
576
5.97k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.97k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.97k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.97k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
41
        }
584
6.01k
    }
585
586
6.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
6.01k
    _rows_returned_counter =
591
6.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.01k
    _blocks_returned_counter =
593
6.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.01k
    _output_block_bytes_counter =
595
6.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.01k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.01k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.01k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.01k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.01k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.01k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.01k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.01k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.01k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.01k
    _memory_used_counter =
606
6.01k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.01k
    _common_profile->add_info_string("IsColocate",
608
6.01k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.01k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.01k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.01k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.01k
    return Status::OK();
613
6.01k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.65k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.65k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.65k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.65k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.65k
    _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.65k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.65k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.65k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.65k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.65k
    if constexpr (!is_fake_shared) {
560
8.65k
        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.65k
        } 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.53k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.53k
            _dependency = _shared_state->create_source_dependency(
576
8.53k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.53k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.53k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.53k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
117
        }
584
8.65k
    }
585
586
8.65k
    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.65k
    _rows_returned_counter =
591
8.65k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.65k
    _blocks_returned_counter =
593
8.65k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.65k
    _output_block_bytes_counter =
595
8.65k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.65k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.65k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.65k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.65k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.65k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.65k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.65k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.65k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.65k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.65k
    _memory_used_counter =
606
8.65k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.65k
    _common_profile->add_info_string("IsColocate",
608
8.65k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.65k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.65k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.65k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.65k
    return Status::OK();
613
8.65k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
91.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
91.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
91.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
91.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
91.5k
    _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
91.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
91.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
91.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
91.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
91.5k
    if constexpr (!is_fake_shared) {
560
91.5k
        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
91.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
90.1k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
90.1k
            _dependency = _shared_state->create_source_dependency(
576
90.1k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
90.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
90.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
90.1k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.40k
        }
584
91.5k
    }
585
586
91.5k
    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
91.5k
    _rows_returned_counter =
591
91.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
91.5k
    _blocks_returned_counter =
593
91.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
91.5k
    _output_block_bytes_counter =
595
91.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
91.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
91.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
91.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
91.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
91.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
91.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
91.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
91.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
91.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
91.5k
    _memory_used_counter =
606
91.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
91.5k
    _common_profile->add_info_string("IsColocate",
608
91.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
91.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
91.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
91.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
91.5k
    return Status::OK();
613
91.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
73.1k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
73.1k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
73.1k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
73.1k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
73.1k
    _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
73.1k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
73.1k
    _operator_profile->add_child(_common_profile.get(), true);
557
73.1k
    _operator_profile->add_child(_custom_profile.get(), true);
558
73.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
73.1k
    if constexpr (!is_fake_shared) {
560
73.1k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
73.0k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
73.0k
                                    .first.get()
563
73.0k
                                    ->template cast<SharedStateArg>();
564
565
73.0k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
73.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
73.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
73.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
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
76
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
76
        }
584
73.1k
    }
585
586
73.1k
    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
73.1k
    _rows_returned_counter =
591
73.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
73.1k
    _blocks_returned_counter =
593
73.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
73.1k
    _output_block_bytes_counter =
595
73.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
73.1k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
73.1k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
73.1k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
73.1k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
73.1k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
73.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
73.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
73.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
73.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
73.1k
    _memory_used_counter =
606
73.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
73.1k
    _common_profile->add_info_string("IsColocate",
608
73.1k
                                     std::to_string(_parent->is_colocated_operator()));
609
73.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
73.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
73.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
73.1k
    return Status::OK();
613
73.1k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
38
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
38
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
38
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
38
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
38
    _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
38
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
38
    _operator_profile->add_child(_common_profile.get(), true);
557
38
    _operator_profile->add_child(_custom_profile.get(), true);
558
38
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
38
    if constexpr (!is_fake_shared) {
560
38
        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
38
        } 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
38
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
38
            _dependency = _shared_state->create_source_dependency(
576
38
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
38
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
38
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
38
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
38
    }
585
586
38
    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
38
    _rows_returned_counter =
591
38
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
38
    _blocks_returned_counter =
593
38
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
38
    _output_block_bytes_counter =
595
38
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
38
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
38
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
38
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
38
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
38
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
38
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
38
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
38
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
38
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
38
    _memory_used_counter =
606
38
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
38
    _common_profile->add_info_string("IsColocate",
608
38
                                     std::to_string(_parent->is_colocated_operator()));
609
38
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
38
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
38
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
38
    return Status::OK();
613
38
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
772k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
772k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
772k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
772k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
772k
    _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
772k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
772k
    _operator_profile->add_child(_common_profile.get(), true);
557
772k
    _operator_profile->add_child(_custom_profile.get(), true);
558
772k
    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
772k
    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
772k
    _rows_returned_counter =
591
772k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
772k
    _blocks_returned_counter =
593
772k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
772k
    _output_block_bytes_counter =
595
772k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
772k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
772k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
772k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
772k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
772k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
772k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
772k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
772k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
772k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
772k
    _memory_used_counter =
606
772k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
772k
    _common_profile->add_info_string("IsColocate",
608
772k
                                     std::to_string(_parent->is_colocated_operator()));
609
772k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
772k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
772k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
772k
    return Status::OK();
613
772k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
55.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
55.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
55.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
55.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
55.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
55.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
55.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
55.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
55.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
55.0k
    if constexpr (!is_fake_shared) {
560
55.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
55.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
4.27k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.27k
            _dependency = _shared_state->create_source_dependency(
576
4.27k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.27k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.27k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.7k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
50.7k
        }
584
55.0k
    }
585
586
55.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
55.0k
    _rows_returned_counter =
591
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
55.0k
    _blocks_returned_counter =
593
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
55.0k
    _output_block_bytes_counter =
595
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
55.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
55.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
55.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
55.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
55.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
55.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
55.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
55.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
55.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
55.0k
    _memory_used_counter =
606
55.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
55.0k
    _common_profile->add_info_string("IsColocate",
608
55.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
55.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
55.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
55.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
55.0k
    return Status::OK();
613
55.0k
}
_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
5.28k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.28k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.28k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.28k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.28k
    _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.28k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.28k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.28k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.28k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.28k
    if constexpr (!is_fake_shared) {
560
5.28k
        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.28k
        } 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
5.25k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.25k
            _dependency = _shared_state->create_source_dependency(
576
5.25k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.25k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.25k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.25k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
27
        }
584
5.28k
    }
585
586
5.28k
    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.28k
    _rows_returned_counter =
591
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.28k
    _blocks_returned_counter =
593
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.28k
    _output_block_bytes_counter =
595
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.28k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.28k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.28k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.28k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.28k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.28k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.28k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.28k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.28k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.28k
    _memory_used_counter =
606
5.28k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.28k
    _common_profile->add_info_string("IsColocate",
608
5.28k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.28k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.28k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.28k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.28k
    return Status::OK();
613
5.28k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
353
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
353
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
353
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
353
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
353
    _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
353
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
353
    _operator_profile->add_child(_common_profile.get(), true);
557
353
    _operator_profile->add_child(_custom_profile.get(), true);
558
353
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
353
    if constexpr (!is_fake_shared) {
560
353
        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
353
        } 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
352
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
352
            _dependency = _shared_state->create_source_dependency(
576
352
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
352
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
352
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
352
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
353
    }
585
586
353
    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
353
    _rows_returned_counter =
591
353
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
353
    _blocks_returned_counter =
593
353
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
353
    _output_block_bytes_counter =
595
353
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
353
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
353
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
353
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
353
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
353
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
353
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
353
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
353
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
353
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
353
    _memory_used_counter =
606
353
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
353
    _common_profile->add_info_string("IsColocate",
608
353
                                     std::to_string(_parent->is_colocated_operator()));
609
353
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
353
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
353
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
353
    return Status::OK();
613
353
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.28k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.28k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.28k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.28k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.28k
    _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.28k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.28k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.28k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.28k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.28k
    if constexpr (!is_fake_shared) {
560
5.28k
        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.28k
        } 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
5.06k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.06k
            _dependency = _shared_state->create_source_dependency(
576
5.06k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.06k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.06k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.06k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
227
        }
584
5.28k
    }
585
586
5.28k
    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.28k
    _rows_returned_counter =
591
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.28k
    _blocks_returned_counter =
593
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.28k
    _output_block_bytes_counter =
595
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.28k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.28k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.28k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.28k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.28k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.28k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.28k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.28k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.28k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.28k
    _memory_used_counter =
606
5.28k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.28k
    _common_profile->add_info_string("IsColocate",
608
5.28k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.28k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.28k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.28k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.28k
    return Status::OK();
613
5.28k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
603k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
603k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
603k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
603k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
603k
    _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
603k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
603k
    _operator_profile->add_child(_common_profile.get(), true);
557
603k
    _operator_profile->add_child(_custom_profile.get(), true);
558
603k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
603k
    if constexpr (!is_fake_shared) {
560
603k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
593k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
593k
                                    .first.get()
563
593k
                                    ->template cast<SharedStateArg>();
564
565
593k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
593k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
593k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
593k
        } 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
9.57k
        } else {
580
9.57k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
9.57k
                DCHECK(false);
582
9.57k
            }
583
9.57k
        }
584
603k
    }
585
586
603k
    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
603k
    _rows_returned_counter =
591
603k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
603k
    _blocks_returned_counter =
593
603k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
603k
    _output_block_bytes_counter =
595
603k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
603k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
603k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
603k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
603k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
603k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
603k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
603k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
603k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
603k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
603k
    _memory_used_counter =
606
603k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
603k
    _common_profile->add_info_string("IsColocate",
608
603k
                                     std::to_string(_parent->is_colocated_operator()));
609
603k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
603k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
603k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
603k
    return Status::OK();
613
603k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
169
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
169
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
169
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
169
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
169
    _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
169
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
169
    _operator_profile->add_child(_common_profile.get(), true);
557
169
    _operator_profile->add_child(_custom_profile.get(), true);
558
169
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
169
    if constexpr (!is_fake_shared) {
560
169
        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
169
        } 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
169
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
169
            _dependency = _shared_state->create_source_dependency(
576
169
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
169
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
169
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
169
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
169
    }
585
586
169
    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
169
    _rows_returned_counter =
591
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
169
    _blocks_returned_counter =
593
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
169
    _output_block_bytes_counter =
595
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
169
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
169
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
169
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
169
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
169
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
169
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
169
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
169
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
169
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
169
    _memory_used_counter =
606
169
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
169
    _common_profile->add_info_string("IsColocate",
608
169
                                     std::to_string(_parent->is_colocated_operator()));
609
169
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
169
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
169
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
169
    return Status::OK();
613
169
}
614
615
template <typename SharedStateArg>
616
1.91M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.91M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.22M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
302k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
302k
    }
621
1.91M
    if (_parent->has_projection()) {
622
381k
        const auto& projection = *_parent->_projection;
623
381k
        _projections.resize(projection.projections.size());
624
2.37M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.99M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.99M
        }
627
381k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
398k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
17.2k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
236k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
218k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
218k
                        state, _intermediate_projections[i][j]));
633
218k
            }
634
17.2k
        }
635
381k
    }
636
1.91M
    return Status::OK();
637
1.91M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
75.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
75.2k
    _conjuncts.resize(_parent->_conjuncts.size());
618
76.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.73k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.73k
    }
621
75.2k
    if (_parent->has_projection()) {
622
75.1k
        const auto& projection = *_parent->_projection;
623
75.1k
        _projections.resize(projection.projections.size());
624
409k
        for (size_t i = 0; i < _projections.size(); i++) {
625
333k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
333k
        }
627
75.1k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
83.1k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.96k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
175k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
167k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
167k
                        state, _intermediate_projections[i][j]));
633
167k
            }
634
7.96k
        }
635
75.1k
    }
636
75.2k
    return Status::OK();
637
75.2k
}
_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
216k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
216k
    _conjuncts.resize(_parent->_conjuncts.size());
618
216k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
216k
    if (_parent->has_projection()) {
622
80
        const auto& projection = *_parent->_projection;
623
80
        _projections.resize(projection.projections.size());
624
402
        for (size_t i = 0; i < _projections.size(); i++) {
625
322
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
322
        }
627
80
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
80
        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
80
    }
636
216k
    return Status::OK();
637
216k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
27
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
27
    _conjuncts.resize(_parent->_conjuncts.size());
618
27
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
27
    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
27
    return Status::OK();
637
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.04k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.04k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.12k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
79
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
79
    }
621
6.05k
    if (_parent->has_projection()) {
622
6.05k
        const auto& projection = *_parent->_projection;
623
6.05k
        _projections.resize(projection.projections.size());
624
26.0k
        for (size_t i = 0; i < _projections.size(); i++) {
625
20.0k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
20.0k
        }
627
6.05k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.07k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
21
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
169
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
148
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
148
                        state, _intermediate_projections[i][j]));
633
148
            }
634
21
        }
635
6.05k
    }
636
6.04k
    return Status::OK();
637
6.04k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.71k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.71k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.44k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
736
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
736
    }
621
8.71k
    if (_parent->has_projection()) {
622
4.67k
        const auto& projection = *_parent->_projection;
623
4.67k
        _projections.resize(projection.projections.size());
624
18.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
14.2k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
14.2k
        }
627
4.67k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.76k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
93
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
704
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
611
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
611
                        state, _intermediate_projections[i][j]));
633
611
            }
634
93
        }
635
4.67k
    }
636
8.71k
    return Status::OK();
637
8.71k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
91.7k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
91.7k
    _conjuncts.resize(_parent->_conjuncts.size());
618
93.5k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.80k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.80k
    }
621
91.7k
    if (_parent->has_projection()) {
622
30.5k
        const auto& projection = *_parent->_projection;
623
30.5k
        _projections.resize(projection.projections.size());
624
278k
        for (size_t i = 0; i < _projections.size(); i++) {
625
247k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
247k
        }
627
30.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
30.7k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
200
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.37k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
1.17k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
1.17k
                        state, _intermediate_projections[i][j]));
633
1.17k
            }
634
200
        }
635
30.5k
    }
636
91.7k
    return Status::OK();
637
91.7k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
73.1k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
73.1k
    _conjuncts.resize(_parent->_conjuncts.size());
618
73.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
25
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
25
    }
621
73.1k
    if (_parent->has_projection()) {
622
178
        const auto& projection = *_parent->_projection;
623
178
        _projections.resize(projection.projections.size());
624
645
        for (size_t i = 0; i < _projections.size(); i++) {
625
467
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
467
        }
627
178
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
178
        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
178
    }
636
73.1k
    return Status::OK();
637
73.1k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
42
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
42
    _conjuncts.resize(_parent->_conjuncts.size());
618
42
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
42
    if (_parent->has_projection()) {
622
16
        const auto& projection = *_parent->_projection;
623
16
        _projections.resize(projection.projections.size());
624
48
        for (size_t i = 0; i < _projections.size(); i++) {
625
32
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
32
        }
627
16
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
16
        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
16
    }
636
42
    return Status::OK();
637
42
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
776k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
776k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.07M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
298k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
298k
    }
621
776k
    if (_parent->has_projection()) {
622
253k
        const auto& projection = *_parent->_projection;
623
253k
        _projections.resize(projection.projections.size());
624
1.53M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.27M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.27M
        }
627
253k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
261k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
8.76k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
52.7k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
43.9k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
43.9k
                        state, _intermediate_projections[i][j]));
633
43.9k
            }
634
8.76k
        }
635
253k
    }
636
776k
    return Status::OK();
637
776k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
55.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
55.2k
    _conjuncts.resize(_parent->_conjuncts.size());
618
55.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
55.2k
    if (_parent->has_projection()) {
622
11.5k
        const auto& projection = *_parent->_projection;
623
11.5k
        _projections.resize(projection.projections.size());
624
111k
        for (size_t i = 0; i < _projections.size(); i++) {
625
99.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
99.7k
        }
627
11.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.7k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
215
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
5.36k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
5.14k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
5.14k
                        state, _intermediate_projections[i][j]));
633
5.14k
            }
634
215
        }
635
11.5k
    }
636
55.2k
    return Status::OK();
637
55.2k
}
_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
5.25k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.25k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.62k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
364
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
364
    }
621
5.25k
    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
5.25k
    return Status::OK();
637
5.25k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
353
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
353
    _conjuncts.resize(_parent->_conjuncts.size());
618
353
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
353
    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
353
    return Status::OK();
637
353
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.33k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.33k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.33k
    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.33k
    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.33k
    return Status::OK();
637
5.33k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
605k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
605k
    _conjuncts.resize(_parent->_conjuncts.size());
618
605k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
605k
    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
605k
    return Status::OK();
637
605k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
169
    _conjuncts.resize(_parent->_conjuncts.size());
618
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
169
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
491
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        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
166
    }
636
169
    return Status::OK();
637
169
}
638
639
template <typename SharedStateArg>
640
7.48k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.48k
    if (_terminated) {
642
2
        return Status::OK();
643
2
    }
644
7.47k
    _terminated = true;
645
7.47k
    return Status::OK();
646
7.48k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
389
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
389
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
389
    _terminated = true;
645
389
    return Status::OK();
646
389
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
23
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
23
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
23
    _terminated = true;
645
23
    return Status::OK();
646
23
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
36
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
36
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
36
    _terminated = true;
645
36
    return Status::OK();
646
36
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1
    _terminated = true;
645
1
    return Status::OK();
646
1
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
143
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
143
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
143
    _terminated = true;
645
143
    return Status::OK();
646
143
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
5.63k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5.63k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
5.63k
    _terminated = true;
645
5.63k
    return Status::OK();
646
5.63k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_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_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
160
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
160
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
160
    _terminated = true;
645
160
    return Status::OK();
646
160
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.01k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.01k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
1.01k
    _terminated = true;
645
1.01k
    return Status::OK();
646
1.01k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
33
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
33
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
33
    _terminated = true;
645
33
    return Status::OK();
646
33
}
647
648
template <typename SharedStateArg>
649
2.16M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.16M
    if (_closed) {
651
245k
        return Status::OK();
652
245k
    }
653
1.91M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.14M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.14M
    }
656
1.91M
    _closed = true;
657
1.91M
    return Status::OK();
658
2.16M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
75.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
75.1k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
75.1k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
75.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
75.1k
    }
656
75.1k
    _closed = true;
657
75.1k
    return Status::OK();
658
75.1k
}
_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
428k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
428k
    if (_closed) {
651
215k
        return Status::OK();
652
215k
    }
653
213k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
213k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
213k
    }
656
213k
    _closed = true;
657
213k
    return Status::OK();
658
428k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
27
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
27
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
27
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
27
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
27
    }
656
27
    _closed = true;
657
27
    return Status::OK();
658
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.05k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.05k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.05k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.05k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.05k
    }
656
6.05k
    _closed = true;
657
6.05k
    return Status::OK();
658
6.05k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
17.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
17.5k
    if (_closed) {
651
8.87k
        return Status::OK();
652
8.87k
    }
653
8.68k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.68k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.68k
    }
656
8.68k
    _closed = true;
657
8.68k
    return Status::OK();
658
17.5k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
91.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
91.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
91.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
91.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
91.6k
    }
656
91.6k
    _closed = true;
657
91.6k
    return Status::OK();
658
91.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
72.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
72.7k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
72.7k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
72.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
72.7k
    }
656
72.7k
    _closed = true;
657
72.7k
    return Status::OK();
658
72.7k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_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_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
792k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
792k
    if (_closed) {
651
15.3k
        return Status::OK();
652
15.3k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
776k
    _closed = true;
657
776k
    return Status::OK();
658
792k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
55.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
55.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
55.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
55.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
55.2k
    }
656
55.2k
    _closed = true;
657
55.2k
    return Status::OK();
658
55.2k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
27
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
27
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
13
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
13
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
13
    }
656
13
    _closed = true;
657
13
    return Status::OK();
658
27
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.23k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.23k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.23k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.23k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.23k
    }
656
5.23k
    _closed = true;
657
5.23k
    return Status::OK();
658
5.23k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
501
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
501
    if (_closed) {
651
250
        return Status::OK();
652
250
    }
653
251
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
251
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
251
    }
656
251
    _closed = true;
657
251
    return Status::OK();
658
501
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.9k
    if (_closed) {
651
5.57k
        return Status::OK();
652
5.57k
    }
653
5.32k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.32k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.32k
    }
656
5.32k
    _closed = true;
657
5.32k
    return Status::OK();
658
10.9k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
607k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
607k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
607k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
607k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
607k
    }
656
607k
    _closed = true;
657
607k
    return Status::OK();
658
607k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
339
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
339
    if (_closed) {
651
179
        return Status::OK();
652
179
    }
653
160
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
160
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
160
    }
656
160
    _closed = true;
657
160
    return Status::OK();
658
339
}
659
660
template <typename SharedState>
661
1.64M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.64M
    _operator_profile =
664
1.64M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.64M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.64M
    _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.64M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.64M
    _operator_profile->add_child(_common_profile, true);
673
1.64M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.64M
    _operator_profile->set_metadata(_parent->node_id());
676
1.64M
    _wait_for_finish_dependency_timer =
677
1.64M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.64M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.64M
    if constexpr (!is_fake_shared) {
680
1.16M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.16M
            info.shared_state_map.end()) {
682
312k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
223k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
223k
            }
685
312k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
312k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
312k
                                                  ? 0
688
312k
                                                  : info.task_idx]
689
312k
                                  .get();
690
312k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
849k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
849k
            _shared_state = info.shared_state->template cast<SharedState>();
696
849k
            _dependency = _shared_state->create_sink_dependency(
697
849k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
849k
        }
699
1.16M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.16M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.16M
    }
702
703
1.64M
    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.64M
    _rows_input_counter =
708
1.64M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.64M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.64M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.64M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.64M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.64M
    _memory_used_counter =
714
1.64M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.64M
    _common_profile->add_info_string("IsColocate",
716
1.64M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.64M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.64M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.64M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.64M
    return Status::OK();
721
1.64M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
123k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
123k
    _operator_profile =
664
123k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
123k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
123k
    _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
123k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
123k
    _operator_profile->add_child(_common_profile, true);
673
123k
    _operator_profile->add_child(_custom_profile, true);
674
675
123k
    _operator_profile->set_metadata(_parent->node_id());
676
123k
    _wait_for_finish_dependency_timer =
677
123k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
123k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
123k
    if constexpr (!is_fake_shared) {
680
123k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
123k
            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
16.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
16.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
16.5k
                                                  ? 0
688
16.5k
                                                  : info.task_idx]
689
16.5k
                                  .get();
690
16.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
106k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
106k
            _shared_state = info.shared_state->template cast<SharedState>();
696
106k
            _dependency = _shared_state->create_sink_dependency(
697
106k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
106k
        }
699
123k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
123k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
123k
    }
702
703
123k
    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
123k
    _rows_input_counter =
708
123k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
123k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
123k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
123k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
123k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
123k
    _memory_used_counter =
714
123k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
123k
    _common_profile->add_info_string("IsColocate",
716
123k
                                     std::to_string(_parent->is_colocated_operator()));
717
123k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
123k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
123k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
123k
    return Status::OK();
721
123k
}
_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
215k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
215k
    _operator_profile =
664
215k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
215k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
215k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
215k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
215k
    _operator_profile->add_child(_common_profile, true);
673
215k
    _operator_profile->add_child(_custom_profile, true);
674
675
215k
    _operator_profile->set_metadata(_parent->node_id());
676
215k
    _wait_for_finish_dependency_timer =
677
215k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
215k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
215k
    if constexpr (!is_fake_shared) {
680
215k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
215k
            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
215k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
215k
            _shared_state = info.shared_state->template cast<SharedState>();
696
215k
            _dependency = _shared_state->create_sink_dependency(
697
215k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
215k
        }
699
215k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
215k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
215k
    }
702
703
215k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
215k
    _rows_input_counter =
708
215k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
215k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
215k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
215k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
215k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
215k
    _memory_used_counter =
714
215k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
215k
    _common_profile->add_info_string("IsColocate",
716
215k
                                     std::to_string(_parent->is_colocated_operator()));
717
215k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
215k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
215k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
215k
    return Status::OK();
721
215k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
34
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
34
    _operator_profile =
664
34
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
34
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
34
    _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
34
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
34
    _operator_profile->add_child(_common_profile, true);
673
34
    _operator_profile->add_child(_custom_profile, true);
674
675
34
    _operator_profile->set_metadata(_parent->node_id());
676
34
    _wait_for_finish_dependency_timer =
677
34
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
34
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
34
    if constexpr (!is_fake_shared) {
680
34
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
34
            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
34
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
34
            _shared_state = info.shared_state->template cast<SharedState>();
696
34
            _dependency = _shared_state->create_sink_dependency(
697
34
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
34
        }
699
34
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
34
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
34
    }
702
703
34
    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
34
    _rows_input_counter =
708
34
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
34
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
34
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
34
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
34
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
34
    _memory_used_counter =
714
34
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
34
    _common_profile->add_info_string("IsColocate",
716
34
                                     std::to_string(_parent->is_colocated_operator()));
717
34
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
34
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
34
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
34
    return Status::OK();
721
34
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.04k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.04k
    _operator_profile =
664
6.04k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.04k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.04k
    _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
6.04k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.04k
    _operator_profile->add_child(_common_profile, true);
673
6.04k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.04k
    _operator_profile->set_metadata(_parent->node_id());
676
6.04k
    _wait_for_finish_dependency_timer =
677
6.04k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.04k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.04k
    if constexpr (!is_fake_shared) {
680
6.04k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.04k
            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
6.04k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.04k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.04k
            _dependency = _shared_state->create_sink_dependency(
697
6.04k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.04k
        }
699
6.04k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.04k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.04k
    }
702
703
6.04k
    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
6.04k
    _rows_input_counter =
708
6.04k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.04k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.04k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.04k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.04k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.04k
    _memory_used_counter =
714
6.04k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.04k
    _common_profile->add_info_string("IsColocate",
716
6.04k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.04k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.04k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.04k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.04k
    return Status::OK();
721
6.04k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.68k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.68k
    _operator_profile =
664
8.68k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.68k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.68k
    _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.68k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.68k
    _operator_profile->add_child(_common_profile, true);
673
8.68k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.68k
    _operator_profile->set_metadata(_parent->node_id());
676
8.68k
    _wait_for_finish_dependency_timer =
677
8.68k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.68k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.68k
    if constexpr (!is_fake_shared) {
680
8.68k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.68k
            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.68k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.68k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.68k
            _dependency = _shared_state->create_sink_dependency(
697
8.68k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.68k
        }
699
8.68k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.68k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.68k
    }
702
703
8.68k
    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.68k
    _rows_input_counter =
708
8.68k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.68k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.68k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.68k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.68k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.68k
    _memory_used_counter =
714
8.68k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.68k
    _common_profile->add_info_string("IsColocate",
716
8.68k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.68k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.68k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.68k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.68k
    return Status::OK();
721
8.68k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
91.6k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
91.6k
    _operator_profile =
664
91.6k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
91.6k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
91.6k
    _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.6k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
91.6k
    _operator_profile->add_child(_common_profile, true);
673
91.6k
    _operator_profile->add_child(_custom_profile, true);
674
675
91.6k
    _operator_profile->set_metadata(_parent->node_id());
676
91.6k
    _wait_for_finish_dependency_timer =
677
91.6k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
91.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
91.6k
    if constexpr (!is_fake_shared) {
680
91.6k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
91.6k
            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.6k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
91.6k
            _shared_state = info.shared_state->template cast<SharedState>();
696
91.6k
            _dependency = _shared_state->create_sink_dependency(
697
91.6k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
91.6k
        }
699
91.6k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
91.6k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
91.6k
    }
702
703
91.6k
    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.6k
    _rows_input_counter =
708
91.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
91.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
91.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
91.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
91.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
91.6k
    _memory_used_counter =
714
91.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
91.6k
    _common_profile->add_info_string("IsColocate",
716
91.6k
                                     std::to_string(_parent->is_colocated_operator()));
717
91.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
91.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
91.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
91.6k
    return Status::OK();
721
91.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
73.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
73.0k
    _operator_profile =
664
73.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
73.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
73.0k
    _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
73.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
73.0k
    _operator_profile->add_child(_common_profile, true);
673
73.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
73.0k
    _operator_profile->set_metadata(_parent->node_id());
676
73.0k
    _wait_for_finish_dependency_timer =
677
73.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
73.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
73.0k
    if constexpr (!is_fake_shared) {
680
73.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
73.0k
            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
73.0k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
73.0k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
73.0k
                                                  ? 0
688
73.0k
                                                  : info.task_idx]
689
73.0k
                                  .get();
690
73.0k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
73.0k
        } 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
73.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
73.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
73.0k
    }
702
703
73.0k
    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
73.0k
    _rows_input_counter =
708
73.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
73.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
73.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
73.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
73.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
73.0k
    _memory_used_counter =
714
73.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
73.0k
    _common_profile->add_info_string("IsColocate",
716
73.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
73.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
73.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
73.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
73.0k
    return Status::OK();
721
73.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
48
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
48
    _operator_profile =
664
48
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
48
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
48
    _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
48
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
48
    _operator_profile->add_child(_common_profile, true);
673
48
    _operator_profile->add_child(_custom_profile, true);
674
675
48
    _operator_profile->set_metadata(_parent->node_id());
676
48
    _wait_for_finish_dependency_timer =
677
48
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
48
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
48
    if constexpr (!is_fake_shared) {
680
48
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
48
            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
48
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
48
            _shared_state = info.shared_state->template cast<SharedState>();
696
48
            _dependency = _shared_state->create_sink_dependency(
697
48
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
48
        }
699
48
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
48
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
48
    }
702
703
48
    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
48
    _rows_input_counter =
708
48
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
48
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
48
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
48
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
48
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
48
    _memory_used_counter =
714
48
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
48
    _common_profile->add_info_string("IsColocate",
716
48
                                     std::to_string(_parent->is_colocated_operator()));
717
48
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
48
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
48
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
48
    return Status::OK();
721
48
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
481k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
481k
    _operator_profile =
664
481k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
481k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
481k
    _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
481k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
481k
    _operator_profile->add_child(_common_profile, true);
673
481k
    _operator_profile->add_child(_custom_profile, true);
674
675
481k
    _operator_profile->set_metadata(_parent->node_id());
676
481k
    _wait_for_finish_dependency_timer =
677
481k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
481k
    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
481k
    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
481k
    _rows_input_counter =
708
481k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
481k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
481k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
481k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
481k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
481k
    _memory_used_counter =
714
481k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
481k
    _common_profile->add_info_string("IsColocate",
716
481k
                                     std::to_string(_parent->is_colocated_operator()));
717
481k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
481k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
481k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
481k
    return Status::OK();
721
481k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
9.99k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
9.99k
    _operator_profile =
664
9.99k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
9.99k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
9.99k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
9.99k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
9.99k
    _operator_profile->add_child(_common_profile, true);
673
9.99k
    _operator_profile->add_child(_custom_profile, true);
674
675
9.99k
    _operator_profile->set_metadata(_parent->node_id());
676
9.99k
    _wait_for_finish_dependency_timer =
677
9.99k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
9.99k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
9.99k
    if constexpr (!is_fake_shared) {
680
9.99k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
9.99k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
9.99k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
9.99k
            _shared_state = info.shared_state->template cast<SharedState>();
696
9.99k
            _dependency = _shared_state->create_sink_dependency(
697
9.99k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
9.99k
        }
699
9.99k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
9.99k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
9.99k
    }
702
703
9.99k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
9.99k
    _rows_input_counter =
708
9.99k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
9.99k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
9.99k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
9.99k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
9.99k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
9.99k
    _memory_used_counter =
714
9.99k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
9.99k
    _common_profile->add_info_string("IsColocate",
716
9.99k
                                     std::to_string(_parent->is_colocated_operator()));
717
9.99k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
9.99k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
9.99k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
9.99k
    return Status::OK();
721
9.99k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
352
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
352
    _operator_profile =
664
352
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
352
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
352
    _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
352
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
352
    _operator_profile->add_child(_common_profile, true);
673
352
    _operator_profile->add_child(_custom_profile, true);
674
675
352
    _operator_profile->set_metadata(_parent->node_id());
676
352
    _wait_for_finish_dependency_timer =
677
352
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
352
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
352
    if constexpr (!is_fake_shared) {
680
352
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
352
            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
352
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
352
            _shared_state = info.shared_state->template cast<SharedState>();
696
352
            _dependency = _shared_state->create_sink_dependency(
697
352
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
352
        }
699
352
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
352
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
352
    }
702
703
353
    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
352
    _rows_input_counter =
708
352
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
352
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
352
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
352
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
352
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
352
    _memory_used_counter =
714
352
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
352
    _common_profile->add_info_string("IsColocate",
716
352
                                     std::to_string(_parent->is_colocated_operator()));
717
352
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
352
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
352
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
352
    return Status::OK();
721
352
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.17k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.17k
    _operator_profile =
664
2.17k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.17k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.17k
    _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.17k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.17k
    _operator_profile->add_child(_common_profile, true);
673
2.17k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.17k
    _operator_profile->set_metadata(_parent->node_id());
676
2.17k
    _wait_for_finish_dependency_timer =
677
2.17k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.17k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.17k
    if constexpr (!is_fake_shared) {
680
2.17k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.17k
            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.17k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.17k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.17k
            _dependency = _shared_state->create_sink_dependency(
697
2.17k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.17k
        }
699
2.17k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.17k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.17k
    }
702
703
2.17k
    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.17k
    _rows_input_counter =
708
2.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.17k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.17k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.17k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.17k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.17k
    _memory_used_counter =
714
2.17k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.17k
    _common_profile->add_info_string("IsColocate",
716
2.17k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.17k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.17k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.17k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.17k
    return Status::OK();
721
2.17k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
13.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
13.1k
    _operator_profile =
664
13.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
13.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
13.1k
    _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
13.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
13.1k
    _operator_profile->add_child(_common_profile, true);
673
13.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
13.1k
    _operator_profile->set_metadata(_parent->node_id());
676
13.1k
    _wait_for_finish_dependency_timer =
677
13.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
13.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
13.1k
    if constexpr (!is_fake_shared) {
680
13.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
13.1k
            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
13.1k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
13.1k
            _shared_state = info.shared_state->template cast<SharedState>();
696
13.1k
            _dependency = _shared_state->create_sink_dependency(
697
13.1k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
13.1k
        }
699
13.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
13.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
13.1k
    }
702
703
13.1k
    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
13.1k
    _rows_input_counter =
708
13.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
13.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
13.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
13.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
13.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
13.1k
    _memory_used_counter =
714
13.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
13.1k
    _common_profile->add_info_string("IsColocate",
716
13.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
13.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
13.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
13.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
13.1k
    return Status::OK();
721
13.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
222k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
222k
    _operator_profile =
664
222k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
222k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
222k
    _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
222k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
222k
    _operator_profile->add_child(_common_profile, true);
673
222k
    _operator_profile->add_child(_custom_profile, true);
674
675
222k
    _operator_profile->set_metadata(_parent->node_id());
676
222k
    _wait_for_finish_dependency_timer =
677
222k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
222k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
222k
    if constexpr (!is_fake_shared) {
680
222k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
223k
            info.shared_state_map.end()) {
682
223k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
223k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
223k
            }
685
223k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
223k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
223k
                                                  ? 0
688
223k
                                                  : info.task_idx]
689
223k
                                  .get();
690
223k
            _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
222k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
222k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
222k
    }
702
703
222k
    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
222k
    _rows_input_counter =
708
222k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
222k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
222k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
222k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
222k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
222k
    _memory_used_counter =
714
222k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
222k
    _common_profile->add_info_string("IsColocate",
716
222k
                                     std::to_string(_parent->is_colocated_operator()));
717
222k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
222k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
222k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
222k
    return Status::OK();
721
222k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
395k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
395k
    _operator_profile =
664
395k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
395k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
395k
    _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
395k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
395k
    _operator_profile->add_child(_common_profile, true);
673
395k
    _operator_profile->add_child(_custom_profile, true);
674
675
395k
    _operator_profile->set_metadata(_parent->node_id());
676
395k
    _wait_for_finish_dependency_timer =
677
395k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
395k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
395k
    if constexpr (!is_fake_shared) {
680
395k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
395k
            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
395k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
395k
            _shared_state = info.shared_state->template cast<SharedState>();
696
395k
            _dependency = _shared_state->create_sink_dependency(
697
395k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
395k
        }
699
395k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
395k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
395k
    }
702
703
395k
    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
395k
    _rows_input_counter =
708
395k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
395k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
395k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
395k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
395k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
395k
    _memory_used_counter =
714
395k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
395k
    _common_profile->add_info_string("IsColocate",
716
395k
                                     std::to_string(_parent->is_colocated_operator()));
717
395k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
395k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
395k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
395k
    return Status::OK();
721
395k
}
_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
338
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
338
    _operator_profile =
664
338
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
338
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
338
    _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
338
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
338
    _operator_profile->add_child(_common_profile, true);
673
338
    _operator_profile->add_child(_custom_profile, true);
674
675
338
    _operator_profile->set_metadata(_parent->node_id());
676
338
    _wait_for_finish_dependency_timer =
677
338
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
338
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
338
    if constexpr (!is_fake_shared) {
680
338
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
338
            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
338
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
338
            _shared_state = info.shared_state->template cast<SharedState>();
696
338
            _dependency = _shared_state->create_sink_dependency(
697
338
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
338
        }
699
338
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
338
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
338
    }
702
703
338
    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
338
    _rows_input_counter =
708
338
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
338
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
338
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
338
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
338
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
338
    _memory_used_counter =
714
338
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
338
    _common_profile->add_info_string("IsColocate",
716
338
                                     std::to_string(_parent->is_colocated_operator()));
717
338
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
338
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
338
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
338
    return Status::OK();
721
338
}
722
723
template <typename SharedState>
724
1.64M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.64M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.64M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.16M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.16M
    }
731
1.64M
    _closed = true;
732
1.64M
    return Status::OK();
733
1.64M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
123k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
123k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
123k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
123k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
123k
    }
731
123k
    _closed = true;
732
123k
    return Status::OK();
733
123k
}
_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
215k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
215k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
215k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
215k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
215k
    }
731
215k
    _closed = true;
732
215k
    return Status::OK();
733
215k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
25
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
25
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
23
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
23
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
23
    }
731
23
    _closed = true;
732
23
    return Status::OK();
733
25
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.01k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.01k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.01k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.01k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.01k
    }
731
6.01k
    _closed = true;
732
6.01k
    return Status::OK();
733
6.01k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.67k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.67k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.67k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.67k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.67k
    }
731
8.67k
    _closed = true;
732
8.67k
    return Status::OK();
733
8.67k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
91.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
91.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
91.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
91.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
91.4k
    }
731
91.4k
    _closed = true;
732
91.4k
    return Status::OK();
733
91.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
72.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
72.7k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
72.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
72.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
72.7k
    }
731
72.7k
    _closed = true;
732
72.7k
    return Status::OK();
733
72.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
36
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
36
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
36
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
36
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
36
    }
731
36
    _closed = true;
732
36
    return Status::OK();
733
36
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
483k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
483k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
    }
731
483k
    _closed = true;
732
483k
    return Status::OK();
733
483k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
10.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
10.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
10.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
10.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
10.0k
    }
731
10.0k
    _closed = true;
732
10.0k
    return Status::OK();
733
10.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
251
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
251
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
251
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
251
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
251
    }
731
251
    _closed = true;
732
251
    return Status::OK();
733
251
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.18k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.18k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.18k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.18k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.18k
    }
731
2.18k
    _closed = true;
732
2.18k
    return Status::OK();
733
2.18k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
13.1k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
13.1k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
13.1k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
13.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
13.1k
    }
731
13.1k
    _closed = true;
732
13.1k
    return Status::OK();
733
13.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
223k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
223k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
223k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
223k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
223k
    }
731
223k
    _closed = true;
732
223k
    return Status::OK();
733
223k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
397k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
397k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
397k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
397k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
397k
    }
731
397k
    _closed = true;
732
397k
    return Status::OK();
733
397k
}
_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
338
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
338
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
338
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
338
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
338
    }
731
338
    _closed = true;
732
338
    return Status::OK();
733
338
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
4.51k
                                                          bool* eos) {
738
4.51k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.51k
    return pull(state, block, eos);
740
4.51k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
38
                                                          bool* eos) {
738
38
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
38
    return pull(state, block, eos);
740
38
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.47k
                                                          bool* eos) {
738
4.47k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.47k
    return pull(state, block, eos);
740
4.47k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
493k
                                                         bool* eos) {
745
493k
    auto& local_state = get_local_state(state);
746
493k
    if (need_more_input_data(state)) {
747
460k
        local_state._child_block->clear_column_data(
748
460k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
460k
                        .num_materialized_slots());
750
460k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
460k
                state, local_state._child_block.get(), &local_state._child_eos));
752
460k
        *eos = local_state._child_eos;
753
460k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
76.3k
            return Status::OK();
755
76.3k
        }
756
384k
        {
757
384k
            SCOPED_TIMER(local_state.exec_time_counter());
758
384k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
384k
        }
760
384k
    }
761
762
417k
    if (!need_more_input_data(state)) {
763
390k
        SCOPED_TIMER(local_state.exec_time_counter());
764
390k
        bool new_eos = false;
765
390k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
390k
        if (new_eos) {
767
313k
            *eos = true;
768
313k
        } else if (!need_more_input_data(state)) {
769
24.9k
            *eos = false;
770
24.9k
        }
771
390k
    }
772
417k
    return Status::OK();
773
417k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
138k
                                                         bool* eos) {
745
138k
    auto& local_state = get_local_state(state);
746
138k
    if (need_more_input_data(state)) {
747
119k
        local_state._child_block->clear_column_data(
748
119k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
119k
                        .num_materialized_slots());
750
119k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
119k
                state, local_state._child_block.get(), &local_state._child_eos));
752
119k
        *eos = local_state._child_eos;
753
119k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
30.9k
            return Status::OK();
755
30.9k
        }
756
88.5k
        {
757
88.5k
            SCOPED_TIMER(local_state.exec_time_counter());
758
88.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
88.5k
        }
760
88.5k
    }
761
762
107k
    if (!need_more_input_data(state)) {
763
107k
        SCOPED_TIMER(local_state.exec_time_counter());
764
107k
        bool new_eos = false;
765
107k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
107k
        if (new_eos) {
767
50.8k
            *eos = true;
768
56.6k
        } else if (!need_more_input_data(state)) {
769
10.6k
            *eos = false;
770
10.6k
        }
771
107k
    }
772
107k
    return Status::OK();
773
107k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.60k
                                                         bool* eos) {
745
4.60k
    auto& local_state = get_local_state(state);
746
4.60k
    if (need_more_input_data(state)) {
747
2.59k
        local_state._child_block->clear_column_data(
748
2.59k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.59k
                        .num_materialized_slots());
750
2.59k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.59k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.59k
        *eos = local_state._child_eos;
753
2.59k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
480
            return Status::OK();
755
480
        }
756
2.11k
        {
757
2.11k
            SCOPED_TIMER(local_state.exec_time_counter());
758
2.11k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
2.11k
        }
760
2.11k
    }
761
762
4.15k
    if (!need_more_input_data(state)) {
763
4.15k
        SCOPED_TIMER(local_state.exec_time_counter());
764
4.15k
        bool new_eos = false;
765
4.15k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
4.15k
        if (new_eos) {
767
1.45k
            *eos = true;
768
2.70k
        } else if (!need_more_input_data(state)) {
769
2.02k
            *eos = false;
770
2.02k
        }
771
4.15k
    }
772
4.12k
    return Status::OK();
773
4.12k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.96k
                                                         bool* eos) {
745
1.96k
    auto& local_state = get_local_state(state);
746
1.96k
    if (need_more_input_data(state)) {
747
1.96k
        local_state._child_block->clear_column_data(
748
1.96k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.96k
                        .num_materialized_slots());
750
1.96k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.96k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.96k
        *eos = local_state._child_eos;
753
1.96k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
777
            return Status::OK();
755
777
        }
756
1.19k
        {
757
1.19k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.19k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.19k
        }
760
1.19k
    }
761
762
1.19k
    if (!need_more_input_data(state)) {
763
1.19k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.19k
        bool new_eos = false;
765
1.19k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.19k
        if (new_eos) {
767
792
            *eos = true;
768
792
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.19k
    }
772
1.19k
    return Status::OK();
773
1.19k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
19.4k
                                                         bool* eos) {
745
19.4k
    auto& local_state = get_local_state(state);
746
19.4k
    if (need_more_input_data(state)) {
747
19.4k
        local_state._child_block->clear_column_data(
748
19.4k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
19.4k
                        .num_materialized_slots());
750
19.4k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
19.4k
                state, local_state._child_block.get(), &local_state._child_eos));
752
19.4k
        *eos = local_state._child_eos;
753
19.4k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
5.33k
            return Status::OK();
755
5.33k
        }
756
14.1k
        {
757
14.1k
            SCOPED_TIMER(local_state.exec_time_counter());
758
14.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
14.1k
        }
760
14.1k
    }
761
762
14.1k
    if (!need_more_input_data(state)) {
763
7.37k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.37k
        bool new_eos = false;
765
7.37k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.37k
        if (new_eos) {
767
7.30k
            *eos = true;
768
7.30k
        } else if (!need_more_input_data(state)) {
769
9
            *eos = false;
770
9
        }
771
7.37k
    }
772
14.1k
    return Status::OK();
773
14.1k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
299k
                                                         bool* eos) {
745
299k
    auto& local_state = get_local_state(state);
746
300k
    if (need_more_input_data(state)) {
747
300k
        local_state._child_block->clear_column_data(
748
300k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
300k
                        .num_materialized_slots());
750
300k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
300k
                state, local_state._child_block.get(), &local_state._child_eos));
752
300k
        *eos = local_state._child_eos;
753
300k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
37.0k
            return Status::OK();
755
37.0k
        }
756
263k
        {
757
263k
            SCOPED_TIMER(local_state.exec_time_counter());
758
263k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
263k
        }
760
263k
    }
761
762
262k
    if (!need_more_input_data(state)) {
763
243k
        SCOPED_TIMER(local_state.exec_time_counter());
764
243k
        bool new_eos = false;
765
243k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
243k
        if (new_eos) {
767
243k
            *eos = true;
768
243k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
243k
    }
772
262k
    return Status::OK();
773
262k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
22.1k
                                                         bool* eos) {
745
22.1k
    auto& local_state = get_local_state(state);
746
22.1k
    if (need_more_input_data(state)) {
747
10.3k
        local_state._child_block->clear_column_data(
748
10.3k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.3k
                        .num_materialized_slots());
750
10.3k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.3k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.3k
        *eos = local_state._child_eos;
753
10.3k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
586
            return Status::OK();
755
586
        }
756
9.71k
        {
757
9.71k
            SCOPED_TIMER(local_state.exec_time_counter());
758
9.71k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
9.71k
        }
760
9.71k
    }
761
762
21.5k
    if (!need_more_input_data(state)) {
763
21.0k
        SCOPED_TIMER(local_state.exec_time_counter());
764
21.0k
        bool new_eos = false;
765
21.0k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
21.0k
        if (new_eos) {
767
6.02k
            *eos = true;
768
14.9k
        } else if (!need_more_input_data(state)) {
769
11.8k
            *eos = false;
770
11.8k
        }
771
21.0k
    }
772
21.5k
    return Status::OK();
773
21.5k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.21k
                                                         bool* eos) {
745
7.21k
    auto& local_state = get_local_state(state);
746
7.21k
    if (need_more_input_data(state)) {
747
6.85k
        local_state._child_block->clear_column_data(
748
6.85k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.85k
                        .num_materialized_slots());
750
6.85k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.85k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.85k
        *eos = local_state._child_eos;
753
6.85k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.18k
            return Status::OK();
755
1.18k
        }
756
5.67k
        {
757
5.67k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.67k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.67k
        }
760
5.67k
    }
761
762
6.04k
    if (!need_more_input_data(state)) {
763
6.04k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.04k
        bool new_eos = false;
765
6.04k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.04k
        if (new_eos) {
767
3.97k
            *eos = true;
768
3.97k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.04k
    }
772
6.03k
    return Status::OK();
773
6.03k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
48.3k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
48.3k
    RETURN_IF_ERROR(Base::init(state, info));
779
48.3k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
48.3k
                                                         "AsyncWriterDependency", true);
781
48.3k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
48.3k
                             _finish_dependency));
783
784
48.3k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
48.3k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
48.3k
    return Status::OK();
787
48.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
379
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
379
    RETURN_IF_ERROR(Base::init(state, info));
779
379
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
379
                                                         "AsyncWriterDependency", true);
781
379
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
379
                             _finish_dependency));
783
784
379
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
379
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
379
    return Status::OK();
787
379
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
48.0k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
48.0k
    RETURN_IF_ERROR(Base::init(state, info));
779
48.0k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
48.0k
                                                         "AsyncWriterDependency", true);
781
48.0k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
48.0k
                             _finish_dependency));
783
784
48.0k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
48.0k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
48.0k
    return Status::OK();
787
48.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
8
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
8
    RETURN_IF_ERROR(Base::init(state, info));
779
8
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
8
                                                         "AsyncWriterDependency", true);
781
8
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
8
                             _finish_dependency));
783
784
8
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
8
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
8
    return Status::OK();
787
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
49.2k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
49.2k
    RETURN_IF_ERROR(Base::open(state));
793
49.2k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
387k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
338k
        RETURN_IF_ERROR(
796
338k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
338k
    }
798
49.2k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
49.2k
    return Status::OK();
800
49.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
379
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
379
    RETURN_IF_ERROR(Base::open(state));
793
379
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.90k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.53k
        RETURN_IF_ERROR(
796
1.53k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.53k
    }
798
379
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
379
    return Status::OK();
800
379
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
48.8k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
48.8k
    RETURN_IF_ERROR(Base::open(state));
793
48.8k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
385k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
336k
        RETURN_IF_ERROR(
796
336k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
336k
    }
798
48.8k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
48.8k
    return Status::OK();
800
48.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
8
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
8
    RETURN_IF_ERROR(Base::open(state));
793
8
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
144
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
136
        RETURN_IF_ERROR(
796
136
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
136
    }
798
8
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
8
    return Status::OK();
800
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
64.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
64.5k
    return _writer->sink(block, eos);
806
64.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.58k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.58k
    return _writer->sink(block, eos);
806
1.58k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
62.9k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.9k
    return _writer->sink(block, eos);
806
62.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
8
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
8
    return _writer->sink(block, eos);
806
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
49.2k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
49.2k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
49.2k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
49.2k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
49.3k
    if (_writer) {
818
49.3k
        Status st = _writer->get_writer_status();
819
49.3k
        if (exec_status.ok()) {
820
49.2k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
49.2k
                                                       : Status::Cancelled("force close"));
822
49.2k
        } else {
823
106
            _writer->force_close(exec_status);
824
106
        }
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
49.3k
        RETURN_IF_ERROR(st);
829
49.3k
    }
830
49.2k
    return Base::close(state, exec_status);
831
49.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
368
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
368
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
368
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
368
    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
368
    if (_writer) {
818
368
        Status st = _writer->get_writer_status();
819
368
        if (exec_status.ok()) {
820
368
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
368
                                                       : Status::Cancelled("force close"));
822
368
        } 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
368
        RETURN_IF_ERROR(st);
829
368
    }
830
368
    return Base::close(state, exec_status);
831
368
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
48.8k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
48.8k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
48.8k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
48.8k
    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
48.9k
    if (_writer) {
818
48.9k
        Status st = _writer->get_writer_status();
819
48.9k
        if (exec_status.ok()) {
820
48.8k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
48.8k
                                                       : Status::Cancelled("force close"));
822
48.8k
        } else {
823
106
            _writer->force_close(exec_status);
824
106
        }
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
48.9k
        RETURN_IF_ERROR(st);
829
48.9k
    }
830
48.8k
    return Base::close(state, exec_status);
831
48.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
8
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
8
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
8
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
8
    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
8
    if (_writer) {
818
8
        Status st = _writer->get_writer_status();
819
8
        if (exec_status.ok()) {
820
8
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
8
                                                       : Status::Cancelled("force close"));
822
8
        } 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
8
        RETURN_IF_ERROR(st);
829
8
    }
830
8
    return Base::close(state, exec_status);
831
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
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