Coverage Report

Created: 2026-09-22 11:36

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.58M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.58M
    if (_parent->nereids_id() == -1) {
122
815k
        return fmt::format("(id={})", _parent->node_id());
123
815k
    } else {
124
765k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
765k
    }
126
1.58M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
66.7k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
66.7k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
66.7k
    } else {
124
66.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
66.7k
    }
126
66.7k
}
_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
229k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
229k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
229k
    } else {
124
229k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
229k
    }
126
229k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
26
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
26
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.90k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.90k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.90k
    } else {
124
5.90k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.90k
    }
126
5.90k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.35k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.35k
    if (_parent->nereids_id() == -1) {
122
14
        return fmt::format("(id={})", _parent->node_id());
123
8.33k
    } else {
124
8.33k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.33k
    }
126
8.35k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
85.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
85.1k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
85.1k
    } else {
124
85.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
85.1k
    }
126
85.1k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
66.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
66.6k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
66.6k
    } else {
124
66.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
66.6k
    }
126
66.6k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
110
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
110
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
110
    } else {
124
110
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
110
    }
126
110
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
472k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
472k
    if (_parent->nereids_id() == -1) {
122
229k
        return fmt::format("(id={})", _parent->node_id());
123
242k
    } else {
124
242k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
242k
    }
126
472k
}
_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
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.98k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.98k
    if (_parent->nereids_id() == -1) {
122
4.98k
        return fmt::format("(id={})", _parent->node_id());
123
4.98k
    } else {
124
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
1
    }
126
4.98k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
314
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
314
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
212
    } else {
124
212
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
212
    }
126
314
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.25k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.25k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.24k
    } else {
124
5.24k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.24k
    }
126
5.25k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
580k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
580k
    if (_parent->nereids_id() == -1) {
122
580k
        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
580k
}
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.13M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.13M
    if (_parent->nereids_id() == -1) {
131
609k
        return fmt::format("(id={})", _parent->node_id());
132
609k
    } else {
133
522k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
522k
    }
135
1.13M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
115k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
115k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
115k
    } else {
133
115k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
115k
    }
135
115k
}
_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
231k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
231k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
231k
    } else {
133
231k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
231k
    }
135
231k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
33
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
33
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
33
    } else {
133
33
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
33
    }
135
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.95k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.95k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.95k
    } else {
133
5.95k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.95k
    }
135
5.95k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.37k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.37k
    if (_parent->nereids_id() == -1) {
131
14
        return fmt::format("(id={})", _parent->node_id());
132
8.36k
    } else {
133
8.36k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.36k
    }
135
8.37k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
85.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
85.5k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
85.5k
    } else {
133
85.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
85.5k
    }
135
85.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
66.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
66.4k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
66.4k
    } else {
133
66.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
66.4k
    }
135
66.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
120
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
120
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
120
    } else {
133
120
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
120
    }
135
120
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
46
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
46
    if (_parent->nereids_id() == -1) {
131
46
        return fmt::format("(id={})", _parent->node_id());
132
46
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
46
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9.49k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9.49k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
9.49k
    } else {
133
9.49k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
9.49k
    }
135
9.49k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
315
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
315
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
213
    } else {
133
213
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
213
    }
135
315
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
13.1k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
13.2k
    if (_parent->nereids_id() == -1) {
131
13.2k
        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.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
223k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
224k
    if (_parent->nereids_id() == -1) {
131
224k
        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
223k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
371k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
371k
    if (_parent->nereids_id() == -1) {
131
371k
        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
371k
}
_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
31.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
31.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
31.0k
    _terminated = true;
143
31.0k
    return Status::OK();
144
31.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2.82k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.82k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.82k
    _terminated = true;
143
2.82k
    return Status::OK();
144
2.82k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1
    _terminated = true;
143
1
    return Status::OK();
144
1
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.58k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.58k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.58k
    _terminated = true;
143
1.58k
    return Status::OK();
144
1.58k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.12k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.12k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.12k
    _terminated = true;
143
1.12k
    return Status::OK();
144
1.12k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_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_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
548
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
548
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
548
    _terminated = true;
143
548
    return Status::OK();
144
548
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
242
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
242
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
242
    _terminated = true;
143
242
    return Status::OK();
144
242
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
17
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
17
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
17
    _terminated = true;
143
17
    return Status::OK();
144
17
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
212
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
212
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
212
    _terminated = true;
143
212
    return Status::OK();
144
212
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
20
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
20
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
20
    _terminated = true;
143
20
    return Status::OK();
144
20
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
253
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
253
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
253
    _terminated = true;
143
253
    return Status::OK();
144
253
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
136
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
136
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
136
    _terminated = true;
143
136
    return Status::OK();
144
136
}
145
146
293k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
293k
    return _child && _child->is_serial_operator() && !is_source()
148
293k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
293k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
293k
}
151
152
21.6k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
21.6k
    if (!_child) {
154
20.4k
        return false;
155
20.4k
    }
156
1.21k
    if (_child->is_serial_operator()) {
157
136
        return true;
158
136
    }
159
1.08k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.08k
    return child_distribution.need_local_exchange() &&
161
1.08k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.21k
}
163
164
template <typename SharedStateArg>
165
16.7k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.7k
    fmt::memory_buffer debug_string_buffer;
167
16.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.7k
    return fmt::to_string(debug_string_buffer);
169
16.7k
}
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.7k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.7k
    fmt::memory_buffer debug_string_buffer;
167
16.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.7k
    return fmt::to_string(debug_string_buffer);
169
16.7k
}
_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.7k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.7k
    fmt::memory_buffer debug_string_buffer;
174
16.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.7k
    return fmt::to_string(debug_string_buffer);
176
16.7k
}
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.7k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.7k
    fmt::memory_buffer debug_string_buffer;
174
16.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.7k
    return fmt::to_string(debug_string_buffer);
176
16.7k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
16.7k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
16.7k
    fmt::memory_buffer debug_string_buffer;
180
16.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
16.7k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
16.7k
                   _is_serial_operator);
183
16.7k
    return fmt::to_string(debug_string_buffer);
184
16.7k
}
185
186
16.7k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
16.7k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
16.7k
}
189
190
637k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
637k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
637k
    _nereids_id = tnode.nereids_id;
193
637k
    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
637k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
637k
    _op_name = substr + "_OPERATOR";
208
209
637k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
637k
    } else if (tnode.__isset.conjuncts) {
212
269k
        for (const auto& conjunct : tnode.conjuncts) {
213
269k
            VExprContextSPtr context;
214
269k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
269k
            _conjuncts.emplace_back(context);
216
269k
        }
217
98.5k
    }
218
219
    // create the projections expr
220
637k
    if (tnode.__isset.projections) {
221
259k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
259k
    }
223
637k
    if (!tnode.intermediate_projections_list.empty()) {
224
18.4E
        DCHECK(has_projection()) << "no final projections";
225
3.87k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.53k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.53k
            VExprContextSPtrs projections;
228
6.53k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.53k
            _projection->intermediate_projections.push_back(projections);
230
6.53k
        }
231
3.87k
    }
232
637k
    return Status::OK();
233
637k
}
234
235
664k
Status OperatorXBase::prepare(RuntimeState* state) {
236
664k
    for (auto& conjunct : _conjuncts) {
237
269k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
269k
    }
239
664k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
614k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
333k
            return a->execute_cost() < b->execute_cost();
242
333k
        });
243
614k
    };
244
245
664k
    if (has_projection()) {
246
259k
        auto& projection = *_projection;
247
265k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.53k
            const auto& input_row_desc =
249
6.53k
                    i == 0 ? operator_row_desc_before_projection()
250
6.53k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.53k
            RETURN_IF_ERROR(
252
6.53k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.53k
        }
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
664k
    for (auto& conjunct : _conjuncts) {
265
269k
        RETURN_IF_ERROR(conjunct->open(state));
266
269k
    }
267
664k
    if (has_projection()) {
268
259k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
259k
        for (auto& projections : _projection->intermediate_projections) {
270
6.53k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.53k
        }
272
259k
    }
273
664k
    if (_child && !is_source()) {
274
89.0k
        RETURN_IF_ERROR(_child->prepare(state));
275
89.0k
    }
276
277
664k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
664k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
664k
    return Status::OK();
283
664k
}
284
285
7.67k
Status OperatorXBase::terminate(RuntimeState* state) {
286
7.67k
    if (_child && !is_source()) {
287
657
        RETURN_IF_ERROR(_child->terminate(state));
288
657
    }
289
7.67k
    auto result = state->get_local_state_result(operator_id());
290
7.67k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
7.67k
    return result.value()->terminate(state);
294
7.67k
}
295
296
4.23M
Status OperatorXBase::close(RuntimeState* state) {
297
4.23M
    if (_child && !is_source()) {
298
607k
        RETURN_IF_ERROR(_child->close(state));
299
607k
    }
300
4.23M
    auto result = state->get_local_state_result(operator_id());
301
4.23M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.23M
    return result.value()->close(state);
305
4.23M
}
306
307
271k
void PipelineXLocalStateBase::clear_origin_block() {
308
271k
    _origin_block.clear_column_data(
309
271k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
271k
}
311
312
640k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
640k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
640k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
640k
    return Status::OK();
317
640k
}
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
271k
                                     Block* output_block) const {
326
271k
    auto* local_state = state->get_local_state(operator_id());
327
271k
    SCOPED_TIMER(local_state->exec_time_counter());
328
271k
    SCOPED_TIMER(local_state->_projection_timer);
329
271k
    const size_t rows = origin_block->rows();
330
271k
    if (rows == 0) {
331
141k
        return Status::OK();
332
141k
    }
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
3.67k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.67k
            new_columns.resize(projections.size());
345
71.3k
            for (int i = 0; i < projections.size(); i++) {
346
67.6k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
67.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
67.6k
            }
355
3.66k
            Block tmp_block {new_columns};
356
3.66k
            input_block.swap(tmp_block);
357
3.66k
        }
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
753k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
622k
            ColumnPtr column_ptr;
374
622k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
622k
            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
622k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
622k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
622k
            if (column_ptr->is_exclusive()) {
386
228k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
394k
            } else {
388
394k
                shared_columns[i] = std::move(column_ptr);
389
394k
            }
390
622k
        }
391
392
130k
        scoped_mutable_block.restore();
393
753k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
623k
            if (shared_columns[i]) {
395
394k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
394k
            }
397
623k
        }
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.85M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
3.85M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
3.85M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
3.85M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
3.85M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
3.85M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
3.85M
            if (_debug_point_count++ % 2 == 0) {
414
3.85M
                return Status::OK();
415
3.85M
            }
416
3.85M
        }
417
3.85M
    });
418
419
3.85M
    Status status;
420
3.85M
    auto* local_state = state->get_local_state(operator_id());
421
3.85M
    Defer defer([&]() {
422
3.85M
        if (status.ok()) {
423
3.85M
            local_state->update_output_block_counters(*block);
424
3.85M
        }
425
3.85M
    });
426
3.85M
    if (has_projection()) {
427
271k
        local_state->clear_origin_block();
428
271k
        status = get_block(state, &local_state->_origin_block, eos);
429
271k
        if (UNLIKELY(!status.ok())) {
430
25
            return status;
431
25
        }
432
271k
        status = do_projections(state, &local_state->_origin_block, block);
433
271k
        return status;
434
271k
    }
435
3.58M
    status = get_block(state, block, eos);
436
3.58M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.58M
    return status;
438
3.58M
}
439
440
2.58M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.58M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.63k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.63k
        *eos = true;
444
9.63k
    }
445
446
2.58M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.58M
        auto op_name = to_lower(_parent->_op_name);
448
2.58M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.58M
        arg_op_name = to_lower(arg_op_name);
450
451
2.58M
        if (op_name == arg_op_name) {
452
2.58M
            *eos = true;
453
2.58M
        }
454
2.58M
    });
455
456
2.58M
    if (auto rows = block->rows()) {
457
728k
        _num_rows_returned += rows;
458
728k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
728k
    }
460
2.58M
}
461
462
31.0k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
31.0k
    auto result = state->get_sink_local_state_result();
464
31.0k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
31.0k
    return result.value()->terminate(state);
468
31.0k
}
469
470
16.7k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
16.7k
    fmt::memory_buffer debug_string_buffer;
472
473
16.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
16.7k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
16.7k
    return fmt::to_string(debug_string_buffer);
476
16.7k
}
477
478
16.7k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
16.7k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
16.7k
}
481
482
336k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
336k
    std::string op_name = "UNKNOWN_SINK";
484
336k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
337k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
337k
        op_name = it->second;
488
337k
    }
489
336k
    _name = op_name + "_OPERATOR";
490
336k
    return Status::OK();
491
336k
}
492
493
285k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
285k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
285k
    _nereids_id = tnode.nereids_id;
496
285k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
285k
    _name = substr + "_SINK_OPERATOR";
498
285k
    return Status::OK();
499
285k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.60M
                                                            LocalSinkStateInfo& info) {
504
1.60M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.60M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.60M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.60M
    return Status::OK();
508
1.60M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
115k
                                                            LocalSinkStateInfo& info) {
504
115k
    auto local_state = LocalStateType::create_unique(this, state);
505
115k
    RETURN_IF_ERROR(local_state->init(state, info));
506
115k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
115k
    return Status::OK();
508
115k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
324k
                                                            LocalSinkStateInfo& info) {
504
324k
    auto local_state = LocalStateType::create_unique(this, state);
505
324k
    RETURN_IF_ERROR(local_state->init(state, info));
506
324k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
324k
    return Status::OK();
508
324k
}
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
46.7k
                                                            LocalSinkStateInfo& info) {
504
46.7k
    auto local_state = LocalStateType::create_unique(this, state);
505
46.7k
    RETURN_IF_ERROR(local_state->init(state, info));
506
46.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
46.7k
    return Status::OK();
508
46.7k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
38
                                                            LocalSinkStateInfo& info) {
504
38
    auto local_state = LocalStateType::create_unique(this, state);
505
38
    RETURN_IF_ERROR(local_state->init(state, info));
506
38
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
38
    return Status::OK();
508
38
}
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.37k
                                                            LocalSinkStateInfo& info) {
504
8.37k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.37k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.37k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.37k
    return Status::OK();
508
8.37k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
45
                                                            LocalSinkStateInfo& info) {
504
45
    auto local_state = LocalStateType::create_unique(this, state);
505
45
    RETURN_IF_ERROR(local_state->init(state, info));
506
45
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
45
    return Status::OK();
508
45
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
232k
                                                            LocalSinkStateInfo& info) {
504
232k
    auto local_state = LocalStateType::create_unique(this, state);
505
232k
    RETURN_IF_ERROR(local_state->init(state, info));
506
232k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
232k
    return Status::OK();
508
232k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
33
                                                            LocalSinkStateInfo& info) {
504
33
    auto local_state = LocalStateType::create_unique(this, state);
505
33
    RETURN_IF_ERROR(local_state->init(state, info));
506
33
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
33
    return Status::OK();
508
33
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
223k
                                                            LocalSinkStateInfo& info) {
504
223k
    auto local_state = LocalStateType::create_unique(this, state);
505
223k
    RETURN_IF_ERROR(local_state->init(state, info));
506
223k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
223k
    return Status::OK();
508
223k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
85.6k
                                                            LocalSinkStateInfo& info) {
504
85.6k
    auto local_state = LocalStateType::create_unique(this, state);
505
85.6k
    RETURN_IF_ERROR(local_state->init(state, info));
506
85.6k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
85.6k
    return Status::OK();
508
85.6k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
66.5k
                                                            LocalSinkStateInfo& info) {
504
66.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
66.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
66.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
66.5k
    return Status::OK();
508
66.5k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
120
                                                            LocalSinkStateInfo& info) {
504
120
    auto local_state = LocalStateType::create_unique(this, state);
505
120
    RETURN_IF_ERROR(local_state->init(state, info));
506
120
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
120
    return Status::OK();
508
120
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
467k
                                                            LocalSinkStateInfo& info) {
504
467k
    auto local_state = LocalStateType::create_unique(this, state);
505
467k
    RETURN_IF_ERROR(local_state->init(state, info));
506
467k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
467k
    return Status::OK();
508
467k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.96k
                                                            LocalSinkStateInfo& info) {
504
5.96k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.96k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.96k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.96k
    return Status::OK();
508
5.96k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
9.49k
                                                            LocalSinkStateInfo& info) {
504
9.49k
    auto local_state = LocalStateType::create_unique(this, state);
505
9.49k
    RETURN_IF_ERROR(local_state->init(state, info));
506
9.49k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9.49k
    return Status::OK();
508
9.49k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1.97k
                                                            LocalSinkStateInfo& info) {
504
1.97k
    auto local_state = LocalStateType::create_unique(this, state);
505
1.97k
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.97k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.97k
    return Status::OK();
508
1.97k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
212
                                                            LocalSinkStateInfo& info) {
504
212
    auto local_state = LocalStateType::create_unique(this, state);
505
212
    RETURN_IF_ERROR(local_state->init(state, info));
506
212
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
212
    return Status::OK();
508
212
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.01k
                                                            LocalSinkStateInfo& info) {
504
5.01k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.01k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.01k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.01k
    return Status::OK();
508
5.01k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.79k
                                                            LocalSinkStateInfo& info) {
504
2.79k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.79k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.79k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.79k
    return Status::OK();
508
2.79k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.73k
                                                            LocalSinkStateInfo& info) {
504
2.73k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.73k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.73k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.73k
    return Status::OK();
508
2.73k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.62k
                                                            LocalSinkStateInfo& info) {
504
2.62k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.62k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.62k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.62k
    return Status::OK();
508
2.62k
}
_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
566
                                                            LocalSinkStateInfo& info) {
504
566
    auto local_state = LocalStateType::create_unique(this, state);
505
566
    RETURN_IF_ERROR(local_state->init(state, info));
506
566
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
566
    return Status::OK();
508
566
}
_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
106
                                                            LocalSinkStateInfo& info) {
504
106
    auto local_state = LocalStateType::create_unique(this, state);
505
106
    RETURN_IF_ERROR(local_state->init(state, info));
506
106
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
106
    return Status::OK();
508
106
}
_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.28M
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.28M
    } else {
519
1.28M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.28M
        ss->id = operator_id();
521
1.28M
        for (auto& dest : dests_id()) {
522
1.27M
            ss->related_op_ids.insert(dest);
523
1.27M
        }
524
1.28M
        return ss;
525
1.28M
    }
526
1.28M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
101k
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
101k
    } else {
519
101k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
101k
        ss->id = operator_id();
521
101k
        for (auto& dest : dests_id()) {
522
100k
            ss->related_op_ids.insert(dest);
523
100k
        }
524
101k
        return ss;
525
101k
    }
526
101k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
325k
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
325k
    } else {
519
325k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
325k
        ss->id = operator_id();
521
325k
        for (auto& dest : dests_id()) {
522
324k
            ss->related_op_ids.insert(dest);
523
324k
        }
524
325k
        return ss;
525
325k
    }
526
325k
}
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
379
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
379
    } else {
519
379
        auto ss = LocalStateType::SharedStateType::create_shared();
520
379
        ss->id = operator_id();
521
379
        for (auto& dest : dests_id()) {
522
379
            ss->related_op_ids.insert(dest);
523
379
        }
524
379
        return ss;
525
379
    }
526
379
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
46.8k
    } else {
519
46.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46.8k
        ss->id = operator_id();
521
46.8k
        for (auto& dest : dests_id()) {
522
46.6k
            ss->related_op_ids.insert(dest);
523
46.6k
        }
524
46.8k
        return ss;
525
46.8k
    }
526
46.8k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
38
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
38
    } else {
519
38
        auto ss = LocalStateType::SharedStateType::create_shared();
520
38
        ss->id = operator_id();
521
38
        for (auto& dest : dests_id()) {
522
38
            ss->related_op_ids.insert(dest);
523
38
        }
524
38
        return ss;
525
38
    }
526
38
}
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.41k
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.41k
    } else {
519
8.41k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.41k
        ss->id = operator_id();
521
8.41k
        for (auto& dest : dests_id()) {
522
8.41k
            ss->related_op_ids.insert(dest);
523
8.41k
        }
524
8.41k
        return ss;
525
8.41k
    }
526
8.41k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_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
45
            ss->related_op_ids.insert(dest);
523
45
        }
524
47
        return ss;
525
47
    }
526
47
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
233k
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
233k
    } else {
519
233k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
233k
        ss->id = operator_id();
521
233k
        for (auto& dest : dests_id()) {
522
233k
            ss->related_op_ids.insert(dest);
523
233k
        }
524
233k
        return ss;
525
233k
    }
526
233k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
35
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
35
    } else {
519
35
        auto ss = LocalStateType::SharedStateType::create_shared();
520
35
        ss->id = operator_id();
521
35
        for (auto& dest : dests_id()) {
522
35
            ss->related_op_ids.insert(dest);
523
35
        }
524
35
        return ss;
525
35
    }
526
35
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
85.8k
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
85.8k
    } else {
519
85.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
85.8k
        ss->id = operator_id();
521
85.9k
        for (auto& dest : dests_id()) {
522
85.9k
            ss->related_op_ids.insert(dest);
523
85.9k
        }
524
85.8k
        return ss;
525
85.8k
    }
526
85.8k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
119
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
119
    } else {
519
119
        auto ss = LocalStateType::SharedStateType::create_shared();
520
119
        ss->id = operator_id();
521
119
        for (auto& dest : dests_id()) {
522
119
            ss->related_op_ids.insert(dest);
523
119
        }
524
119
        return ss;
525
119
    }
526
119
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
469k
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
469k
    } else {
519
469k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
469k
        ss->id = operator_id();
521
469k
        for (auto& dest : dests_id()) {
522
464k
            ss->related_op_ids.insert(dest);
523
464k
        }
524
469k
        return ss;
525
469k
    }
526
469k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
5.97k
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
5.97k
    } else {
519
5.97k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
5.97k
        ss->id = operator_id();
521
5.97k
        for (auto& dest : dests_id()) {
522
5.96k
            ss->related_op_ids.insert(dest);
523
5.96k
        }
524
5.97k
        return ss;
525
5.97k
    }
526
5.97k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
315
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
315
    } else {
519
315
        auto ss = LocalStateType::SharedStateType::create_shared();
520
315
        ss->id = operator_id();
521
315
        for (auto& dest : dests_id()) {
522
315
            ss->related_op_ids.insert(dest);
523
315
        }
524
315
        return ss;
525
315
    }
526
315
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.73k
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.73k
    } else {
519
2.73k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.73k
        ss->id = operator_id();
521
2.73k
        for (auto& dest : dests_id()) {
522
2.72k
            ss->related_op_ids.insert(dest);
523
2.72k
        }
524
2.73k
        return ss;
525
2.73k
    }
526
2.73k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.62k
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.62k
    } else {
519
2.62k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.62k
        ss->id = operator_id();
521
2.62k
        for (auto& dest : dests_id()) {
522
2.61k
            ss->related_op_ids.insert(dest);
523
2.61k
        }
524
2.62k
        return ss;
525
2.62k
    }
526
2.62k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
564
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
564
    } else {
519
564
        auto ss = LocalStateType::SharedStateType::create_shared();
520
564
        ss->id = operator_id();
521
566
        for (auto& dest : dests_id()) {
522
566
            ss->related_op_ids.insert(dest);
523
566
        }
524
564
        return ss;
525
564
    }
526
564
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
106
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
106
    } else {
519
106
        auto ss = LocalStateType::SharedStateType::create_shared();
520
106
        ss->id = operator_id();
521
106
        for (auto& dest : dests_id()) {
522
105
            ss->related_op_ids.insert(dest);
523
105
        }
524
106
        return ss;
525
106
    }
526
106
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.83M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.83M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.83M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.83M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.83M
    return Status::OK();
534
1.83M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
67.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
67.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
67.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
67.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
67.0k
    return Status::OK();
534
67.0k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
239k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
239k
    auto local_state = LocalStateType::create_unique(state, this);
531
239k
    RETURN_IF_ERROR(local_state->init(state, info));
532
239k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
239k
    return Status::OK();
534
239k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
141
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
141
    auto local_state = LocalStateType::create_unique(state, this);
531
141
    RETURN_IF_ERROR(local_state->init(state, info));
532
141
    state->emplace_local_state(operator_id(), std::move(local_state));
533
141
    return Status::OK();
534
141
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.06k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.06k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.06k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.06k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.06k
    return Status::OK();
534
3.06k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.34k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.34k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.34k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.34k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.34k
    return Status::OK();
534
8.34k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.20k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.20k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.20k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.20k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.20k
    return Status::OK();
534
8.20k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
26
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
26
    auto local_state = LocalStateType::create_unique(state, this);
531
26
    RETURN_IF_ERROR(local_state->init(state, info));
532
26
    state->emplace_local_state(operator_id(), std::move(local_state));
533
26
    return Status::OK();
534
26
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
222k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
222k
    auto local_state = LocalStateType::create_unique(state, this);
531
222k
    RETURN_IF_ERROR(local_state->init(state, info));
532
222k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
222k
    return Status::OK();
534
222k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
85.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
85.5k
    auto local_state = LocalStateType::create_unique(state, this);
531
85.5k
    RETURN_IF_ERROR(local_state->init(state, info));
532
85.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
85.5k
    return Status::OK();
534
85.5k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
66.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
66.7k
    auto local_state = LocalStateType::create_unique(state, this);
531
66.7k
    RETURN_IF_ERROR(local_state->init(state, info));
532
66.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
66.7k
    return Status::OK();
534
66.7k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
110
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
110
    auto local_state = LocalStateType::create_unique(state, this);
531
110
    RETURN_IF_ERROR(local_state->init(state, info));
532
110
    state->emplace_local_state(operator_id(), std::move(local_state));
533
110
    return Status::OK();
534
110
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.34k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.34k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.34k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.34k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.34k
    return Status::OK();
534
5.34k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
229k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
229k
    auto local_state = LocalStateType::create_unique(state, this);
531
229k
    RETURN_IF_ERROR(local_state->init(state, info));
532
229k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
229k
    return Status::OK();
534
229k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.52k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.52k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.52k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.52k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.52k
    return Status::OK();
534
1.52k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.95k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.95k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.95k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.95k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.95k
    return Status::OK();
534
5.95k
}
_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.59k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.59k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.59k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.59k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.59k
    return Status::OK();
534
1.59k
}
_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.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.00k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.00k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.00k
    return Status::OK();
534
5.00k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
212
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
212
    auto local_state = LocalStateType::create_unique(state, this);
531
212
    RETURN_IF_ERROR(local_state->init(state, info));
532
212
    state->emplace_local_state(operator_id(), std::move(local_state));
533
212
    return Status::OK();
534
212
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.70k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.70k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.70k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.70k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.70k
    return Status::OK();
534
2.70k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.60k
    return Status::OK();
534
2.60k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
327
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
327
    auto local_state = LocalStateType::create_unique(state, this);
531
327
    RETURN_IF_ERROR(local_state->init(state, info));
532
327
    state->emplace_local_state(operator_id(), std::move(local_state));
533
327
    return Status::OK();
534
327
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.67k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.67k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.67k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.67k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.67k
    return Status::OK();
534
1.67k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.4k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.4k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.4k
    return Status::OK();
534
10.4k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
587k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
587k
    auto local_state = LocalStateType::create_unique(state, this);
531
587k
    RETURN_IF_ERROR(local_state->init(state, info));
532
587k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
587k
    return Status::OK();
534
587k
}
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
786
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
786
    auto local_state = LocalStateType::create_unique(state, this);
531
786
    RETURN_IF_ERROR(local_state->init(state, info));
532
786
    state->emplace_local_state(operator_id(), std::move(local_state));
533
786
    return Status::OK();
534
786
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.08k
    return Status::OK();
534
1.08k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.54k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.54k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.54k
    return Status::OK();
534
6.54k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
212k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
212k
    auto local_state = LocalStateType::create_unique(state, this);
531
212k
    RETURN_IF_ERROR(local_state->init(state, info));
532
212k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
212k
    return Status::OK();
534
212k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.59M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.82M
        : _num_rows_returned(0),
542
1.82M
          _rows_returned_counter(nullptr),
543
1.82M
          _parent(parent),
544
1.82M
          _state(state),
545
1.82M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.83M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.83M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.83M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.83M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.83M
    _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.83M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.83M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.83M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.83M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.83M
    if constexpr (!is_fake_shared) {
560
1.12M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
662k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
662k
                                    .first.get()
563
662k
                                    ->template cast<SharedStateArg>();
564
565
662k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
662k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
662k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
662k
        } else if (info.shared_state) {
569
389k
            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
389k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
389k
            _dependency = _shared_state->create_source_dependency(
576
389k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
389k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
389k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
389k
        } else {
580
71.7k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
9.27k
                DCHECK(false);
582
9.27k
            }
583
71.7k
        }
584
1.12M
    }
585
586
1.83M
    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.83M
    _rows_returned_counter =
591
1.83M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.83M
    _blocks_returned_counter =
593
1.83M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.83M
    _output_block_bytes_counter =
595
1.83M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.83M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.83M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.83M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.83M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.83M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.83M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.83M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.83M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.83M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.83M
    _memory_used_counter =
606
1.83M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.83M
    _common_profile->add_info_string("IsColocate",
608
1.83M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.83M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.83M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.83M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.83M
    return Status::OK();
613
1.83M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
67.1k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
67.1k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
67.1k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
67.1k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
67.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
67.1k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
67.1k
    _operator_profile->add_child(_common_profile.get(), true);
557
67.1k
    _operator_profile->add_child(_custom_profile.get(), true);
558
67.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
67.1k
    if constexpr (!is_fake_shared) {
560
67.1k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
14.1k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
14.1k
                                    .first.get()
563
14.1k
                                    ->template cast<SharedStateArg>();
564
565
14.1k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
14.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
14.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
52.9k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
52.3k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
52.3k
            _dependency = _shared_state->create_source_dependency(
576
52.3k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
52.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
52.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
52.3k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
638
        }
584
67.1k
    }
585
586
67.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
67.1k
    _rows_returned_counter =
591
67.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
67.1k
    _blocks_returned_counter =
593
67.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
67.1k
    _output_block_bytes_counter =
595
67.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
67.1k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
67.1k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
67.1k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
67.1k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
67.1k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
67.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
67.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
67.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
67.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
67.1k
    _memory_used_counter =
606
67.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
67.1k
    _common_profile->add_info_string("IsColocate",
608
67.1k
                                     std::to_string(_parent->is_colocated_operator()));
609
67.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
67.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
67.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
67.1k
    return Status::OK();
613
67.1k
}
_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
232k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
232k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
232k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
232k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
232k
    _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
232k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
232k
    _operator_profile->add_child(_common_profile.get(), true);
557
232k
    _operator_profile->add_child(_custom_profile.get(), true);
558
232k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
232k
    if constexpr (!is_fake_shared) {
560
232k
        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
232k
        } 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
223k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
223k
            _dependency = _shared_state->create_source_dependency(
576
223k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
223k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
223k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
223k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
9.34k
        }
584
232k
    }
585
586
232k
    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
232k
    _rows_returned_counter =
591
232k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
232k
    _blocks_returned_counter =
593
232k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
232k
    _output_block_bytes_counter =
595
232k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
232k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
232k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
232k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
232k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
232k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
232k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
232k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
232k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
232k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
232k
    _memory_used_counter =
606
232k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
232k
    _common_profile->add_info_string("IsColocate",
608
232k
                                     std::to_string(_parent->is_colocated_operator()));
609
232k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
232k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
232k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
232k
    return Status::OK();
613
232k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_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_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.96k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.96k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.96k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.96k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.96k
    _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.96k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.96k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.96k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.96k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.96k
    if constexpr (!is_fake_shared) {
560
5.96k
        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.96k
        } 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.90k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.90k
            _dependency = _shared_state->create_source_dependency(
576
5.90k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.90k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.90k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.90k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
59
        }
584
5.96k
    }
585
586
5.96k
    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.96k
    _rows_returned_counter =
591
5.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.96k
    _blocks_returned_counter =
593
5.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.96k
    _output_block_bytes_counter =
595
5.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.96k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.96k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.96k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.96k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.96k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.96k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.96k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.96k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.96k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.96k
    _memory_used_counter =
606
5.96k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.96k
    _common_profile->add_info_string("IsColocate",
608
5.96k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.96k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.96k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.96k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.96k
    return Status::OK();
613
5.96k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.41k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.41k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.41k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.41k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.41k
    _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.41k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.41k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.41k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.41k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.41k
    if constexpr (!is_fake_shared) {
560
8.41k
        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.41k
        } 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.35k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.35k
            _dependency = _shared_state->create_source_dependency(
576
8.35k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.35k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.35k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.35k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
63
        }
584
8.41k
    }
585
586
8.41k
    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.41k
    _rows_returned_counter =
591
8.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.41k
    _blocks_returned_counter =
593
8.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.41k
    _output_block_bytes_counter =
595
8.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.41k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.41k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.41k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.41k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.41k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.41k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.41k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.41k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.41k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.41k
    _memory_used_counter =
606
8.41k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.41k
    _common_profile->add_info_string("IsColocate",
608
8.41k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.41k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.41k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.41k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.41k
    return Status::OK();
613
8.41k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
85.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
85.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
85.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
85.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
85.7k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
85.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
85.7k
    _operator_profile->add_child(_common_profile.get(), true);
557
85.7k
    _operator_profile->add_child(_custom_profile.get(), true);
558
85.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
85.7k
    if constexpr (!is_fake_shared) {
560
85.7k
        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
85.7k
        } 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
84.3k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
84.3k
            _dependency = _shared_state->create_source_dependency(
576
84.3k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
84.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
84.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
84.3k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.39k
        }
584
85.7k
    }
585
586
85.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
85.7k
    _rows_returned_counter =
591
85.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
85.7k
    _blocks_returned_counter =
593
85.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
85.7k
    _output_block_bytes_counter =
595
85.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
85.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
85.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
85.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
85.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
85.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
85.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
85.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
85.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
85.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
85.7k
    _memory_used_counter =
606
85.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
85.7k
    _common_profile->add_info_string("IsColocate",
608
85.7k
                                     std::to_string(_parent->is_colocated_operator()));
609
85.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
85.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
85.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
85.7k
    return Status::OK();
613
85.7k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
66.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
66.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
66.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
66.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
66.7k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
66.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
66.7k
    _operator_profile->add_child(_common_profile.get(), true);
557
66.7k
    _operator_profile->add_child(_custom_profile.get(), true);
558
66.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
66.7k
    if constexpr (!is_fake_shared) {
560
66.8k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
66.8k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
66.8k
                                    .first.get()
563
66.8k
                                    ->template cast<SharedStateArg>();
564
565
66.8k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
66.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
66.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } 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
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
66.7k
    }
585
586
66.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
66.7k
    _rows_returned_counter =
591
66.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
66.7k
    _blocks_returned_counter =
593
66.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
66.7k
    _output_block_bytes_counter =
595
66.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
66.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
66.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
66.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
66.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
66.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
66.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
66.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
66.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
66.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
66.7k
    _memory_used_counter =
606
66.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
66.7k
    _common_profile->add_info_string("IsColocate",
608
66.7k
                                     std::to_string(_parent->is_colocated_operator()));
609
66.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
66.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
66.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
66.7k
    return Status::OK();
613
66.7k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
110
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
110
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
110
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
110
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
110
    _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
110
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
110
    _operator_profile->add_child(_common_profile.get(), true);
557
110
    _operator_profile->add_child(_custom_profile.get(), true);
558
110
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
110
    if constexpr (!is_fake_shared) {
560
110
        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
110
        } 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
110
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
110
            _dependency = _shared_state->create_source_dependency(
576
110
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
110
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
110
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
110
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
110
    }
585
586
110
    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
110
    _rows_returned_counter =
591
110
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
110
    _blocks_returned_counter =
593
110
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
110
    _output_block_bytes_counter =
595
110
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
110
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
110
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
110
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
110
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
110
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
110
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
110
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
110
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
110
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
110
    _memory_used_counter =
606
110
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
110
    _common_profile->add_info_string("IsColocate",
608
110
                                     std::to_string(_parent->is_colocated_operator()));
609
110
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
110
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
110
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
110
    return Status::OK();
613
110
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
715k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
715k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
715k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
715k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
715k
    _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
715k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
715k
    _operator_profile->add_child(_common_profile.get(), true);
557
715k
    _operator_profile->add_child(_custom_profile.get(), true);
558
715k
    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
715k
    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
715k
    _rows_returned_counter =
591
715k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
715k
    _blocks_returned_counter =
593
715k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
715k
    _output_block_bytes_counter =
595
715k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
715k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
715k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
715k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
715k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
715k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
715k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
715k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
715k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
715k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
715k
    _memory_used_counter =
606
715k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
715k
    _common_profile->add_info_string("IsColocate",
608
715k
                                     std::to_string(_parent->is_colocated_operator()));
609
715k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
715k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
715k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
715k
    return Status::OK();
613
715k
}
_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.28k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.28k
            _dependency = _shared_state->create_source_dependency(
576
4.28k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.28k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.28k
                    _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.00k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.00k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.00k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.00k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.00k
    _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.00k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.00k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.00k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.00k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.00k
    if constexpr (!is_fake_shared) {
560
5.00k
        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.00k
        } 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.95k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.95k
            _dependency = _shared_state->create_source_dependency(
576
4.95k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.95k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.95k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.95k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
49
        }
584
5.00k
    }
585
586
5.00k
    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.00k
    _rows_returned_counter =
591
5.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.00k
    _blocks_returned_counter =
593
5.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.00k
    _output_block_bytes_counter =
595
5.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.00k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.00k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.00k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.00k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.00k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.00k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.00k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.00k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.00k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.00k
    _memory_used_counter =
606
5.00k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.00k
    _common_profile->add_info_string("IsColocate",
608
5.00k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.00k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.00k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.00k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.00k
    return Status::OK();
613
5.00k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
315
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
315
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
315
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
315
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
315
    _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
315
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
315
    _operator_profile->add_child(_common_profile.get(), true);
557
315
    _operator_profile->add_child(_custom_profile.get(), true);
558
315
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
315
    if constexpr (!is_fake_shared) {
560
315
        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
315
        } 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
315
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
315
            _dependency = _shared_state->create_source_dependency(
576
315
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
315
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
315
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
315
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
315
    }
585
586
315
    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
315
    _rows_returned_counter =
591
315
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
315
    _blocks_returned_counter =
593
315
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
315
    _output_block_bytes_counter =
595
315
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
315
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
315
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
315
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
315
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
315
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
315
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
315
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
315
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
315
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
315
    _memory_used_counter =
606
315
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
315
    _common_profile->add_info_string("IsColocate",
608
315
                                     std::to_string(_parent->is_colocated_operator()));
609
315
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
315
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
315
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
315
    return Status::OK();
613
315
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.37k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.37k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.37k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.37k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.37k
    _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.37k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.37k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.37k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.37k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.37k
    if constexpr (!is_fake_shared) {
560
5.37k
        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.37k
        } 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.11k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.11k
            _dependency = _shared_state->create_source_dependency(
576
5.11k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.11k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.11k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.11k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
268
        }
584
5.37k
    }
585
586
5.37k
    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.37k
    _rows_returned_counter =
591
5.37k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.37k
    _blocks_returned_counter =
593
5.37k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.37k
    _output_block_bytes_counter =
595
5.37k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.37k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.37k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.37k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.37k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.37k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.37k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.37k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.37k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.37k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.37k
    _memory_used_counter =
606
5.37k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.37k
    _common_profile->add_info_string("IsColocate",
608
5.37k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.37k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.37k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.37k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.37k
    return Status::OK();
613
5.37k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
590k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
590k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
590k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
590k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
590k
    _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
590k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
590k
    _operator_profile->add_child(_common_profile.get(), true);
557
590k
    _operator_profile->add_child(_custom_profile.get(), true);
558
590k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
590k
    if constexpr (!is_fake_shared) {
560
590k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
581k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
581k
                                    .first.get()
563
581k
                                    ->template cast<SharedStateArg>();
564
565
581k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
581k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
581k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
581k
        } 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.27k
        } else {
580
9.27k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
9.27k
                DCHECK(false);
582
9.27k
            }
583
9.27k
        }
584
590k
    }
585
586
590k
    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
590k
    _rows_returned_counter =
591
590k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
590k
    _blocks_returned_counter =
593
590k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
590k
    _output_block_bytes_counter =
595
590k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
590k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
590k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
590k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
590k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
590k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
590k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
590k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
590k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
590k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
590k
    _memory_used_counter =
606
590k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
590k
    _common_profile->add_info_string("IsColocate",
608
590k
                                     std::to_string(_parent->is_colocated_operator()));
609
590k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
590k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
590k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
590k
    return Status::OK();
613
590k
}
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.84M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.84M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.14M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
299k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
299k
    }
621
1.84M
    if (_parent->has_projection()) {
622
374k
        const auto& projection = *_parent->_projection;
623
374k
        _projections.resize(projection.projections.size());
624
2.31M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.94M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.94M
        }
627
374k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
389k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
15.3k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
217k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
202k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
202k
                        state, _intermediate_projections[i][j]));
633
202k
            }
634
15.3k
        }
635
374k
    }
636
1.84M
    return Status::OK();
637
1.84M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
67.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
67.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
68.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.48k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.48k
    }
621
67.4k
    if (_parent->has_projection()) {
622
67.4k
        const auto& projection = *_parent->_projection;
623
67.4k
        _projections.resize(projection.projections.size());
624
355k
        for (size_t i = 0; i < _projections.size(); i++) {
625
288k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
288k
        }
627
67.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
74.7k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.31k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
165k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
158k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
158k
                        state, _intermediate_projections[i][j]));
633
158k
            }
634
7.31k
        }
635
67.4k
    }
636
67.4k
    return Status::OK();
637
67.4k
}
_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
235k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
235k
    _conjuncts.resize(_parent->_conjuncts.size());
618
235k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
235k
    if (_parent->has_projection()) {
622
79
        const auto& projection = *_parent->_projection;
623
79
        _projections.resize(projection.projections.size());
624
400
        for (size_t i = 0; i < _projections.size(); i++) {
625
321
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
321
        }
627
79
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
79
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
79
    }
636
235k
    return Status::OK();
637
235k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
26
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
26
    _conjuncts.resize(_parent->_conjuncts.size());
618
26
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
26
    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
26
    return Status::OK();
637
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.98k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.98k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.08k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
97
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
97
    }
621
5.99k
    if (_parent->has_projection()) {
622
5.99k
        const auto& projection = *_parent->_projection;
623
5.99k
        _projections.resize(projection.projections.size());
624
26.7k
        for (size_t i = 0; i < _projections.size(); i++) {
625
20.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
20.7k
        }
627
5.99k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.01k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
23
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
167
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
144
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
144
                        state, _intermediate_projections[i][j]));
633
144
            }
634
23
        }
635
5.99k
    }
636
5.98k
    return Status::OK();
637
5.98k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.42k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.42k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.11k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
690
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
690
    }
621
8.42k
    if (_parent->has_projection()) {
622
4.64k
        const auto& projection = *_parent->_projection;
623
4.64k
        _projections.resize(projection.projections.size());
624
19.1k
        for (size_t i = 0; i < _projections.size(); i++) {
625
14.4k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
14.4k
        }
627
4.64k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.72k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
83
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
624
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
541
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
541
                        state, _intermediate_projections[i][j]));
633
541
            }
634
83
        }
635
4.64k
    }
636
8.42k
    return Status::OK();
637
8.42k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
86.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
86.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
87.5k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.51k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.51k
    }
621
86.0k
    if (_parent->has_projection()) {
622
29.3k
        const auto& projection = *_parent->_projection;
623
29.3k
        _projections.resize(projection.projections.size());
624
271k
        for (size_t i = 0; i < _projections.size(); i++) {
625
241k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
241k
        }
627
29.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
29.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
162
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.04k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
881
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
881
                        state, _intermediate_projections[i][j]));
633
881
            }
634
162
        }
635
29.3k
    }
636
86.0k
    return Status::OK();
637
86.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
66.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
66.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
66.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
25
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
25
    }
621
66.8k
    if (_parent->has_projection()) {
622
203
        const auto& projection = *_parent->_projection;
623
203
        _projections.resize(projection.projections.size());
624
765
        for (size_t i = 0; i < _projections.size(); i++) {
625
562
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
562
        }
627
203
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
205
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
2
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
15
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
13
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
13
                        state, _intermediate_projections[i][j]));
633
13
            }
634
2
        }
635
203
    }
636
66.8k
    return Status::OK();
637
66.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
114
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
114
    _conjuncts.resize(_parent->_conjuncts.size());
618
114
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
114
    if (_parent->has_projection()) {
622
86
        const auto& projection = *_parent->_projection;
623
86
        _projections.resize(projection.projections.size());
624
258
        for (size_t i = 0; i < _projections.size(); i++) {
625
172
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
172
        }
627
86
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
86
        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
86
    }
636
114
    return Status::OK();
637
114
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
718k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
718k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.01M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
294k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
294k
    }
621
718k
    if (_parent->has_projection()) {
622
254k
        const auto& projection = *_parent->_projection;
623
254k
        _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
254k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
262k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.57k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
46.2k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
38.7k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
38.7k
                        state, _intermediate_projections[i][j]));
633
38.7k
            }
634
7.57k
        }
635
254k
    }
636
718k
    return Status::OK();
637
718k
}
_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.3k
        const auto& projection = *_parent->_projection;
623
11.3k
        _projections.resize(projection.projections.size());
624
110k
        for (size_t i = 0; i < _projections.size(); i++) {
625
99.4k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
99.4k
        }
627
11.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
194
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3.87k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3.68k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3.68k
                        state, _intermediate_projections[i][j]));
633
3.68k
            }
634
194
        }
635
11.3k
    }
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.00k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.00k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.74k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
737
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
737
    }
621
5.00k
    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.00k
    return Status::OK();
637
5.00k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
315
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
315
    _conjuncts.resize(_parent->_conjuncts.size());
618
315
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
315
    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
315
    return Status::OK();
637
315
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.43k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.43k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.43k
    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.43k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
227
        for (size_t i = 0; i < _projections.size(); i++) {
625
167
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
167
        }
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.43k
    return Status::OK();
637
5.43k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
594k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
594k
    _conjuncts.resize(_parent->_conjuncts.size());
618
594k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
594k
    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
594k
    return Status::OK();
637
594k
}
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.68k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.68k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7.68k
    _terminated = true;
645
7.68k
    return Status::OK();
646
7.68k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
431
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
431
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
431
    _terminated = true;
645
431
    return Status::OK();
646
431
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
27
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
27
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
27
    _terminated = true;
645
27
    return Status::OK();
646
27
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
19
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
19
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
19
    _terminated = true;
645
19
    return Status::OK();
646
19
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
50
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
50
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
50
    _terminated = true;
645
50
    return Status::OK();
646
50
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
5.83k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5.83k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
5.83k
    _terminated = true;
645
5.83k
    return Status::OK();
646
5.83k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
34
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
34
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
34
    _terminated = true;
645
34
    return Status::OK();
646
34
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_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
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
293
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
293
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
293
    _terminated = true;
645
293
    return Status::OK();
646
293
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
956
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
956
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
956
    _terminated = true;
645
956
    return Status::OK();
646
956
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
34
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
34
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
34
    _terminated = true;
645
34
    return Status::OK();
646
34
}
647
648
template <typename SharedStateArg>
649
2.11M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.11M
    if (_closed) {
651
265k
        return Status::OK();
652
265k
    }
653
1.84M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.12M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.12M
    }
656
1.84M
    _closed = true;
657
1.84M
    return Status::OK();
658
2.11M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
67.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
67.3k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
67.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
67.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
67.3k
    }
656
67.3k
    _closed = true;
657
67.3k
    return Status::OK();
658
67.3k
}
_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
466k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
466k
    if (_closed) {
651
234k
        return Status::OK();
652
234k
    }
653
232k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
232k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
232k
    }
656
232k
    _closed = true;
657
232k
    return Status::OK();
658
466k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
26
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
26
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
26
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
26
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
26
    }
656
26
    _closed = true;
657
26
    return Status::OK();
658
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.98k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.98k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.98k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.98k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.98k
    }
656
5.98k
    _closed = true;
657
5.98k
    return Status::OK();
658
5.98k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
16.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
16.9k
    if (_closed) {
651
8.58k
        return Status::OK();
652
8.58k
    }
653
8.41k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.41k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.41k
    }
656
8.41k
    _closed = true;
657
8.41k
    return Status::OK();
658
16.9k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
85.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
85.8k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
85.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
85.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
85.8k
    }
656
85.8k
    _closed = true;
657
85.8k
    return Status::OK();
658
85.8k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
66.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
66.4k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
66.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
66.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
66.4k
    }
656
66.4k
    _closed = true;
657
66.4k
    return Status::OK();
658
66.4k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
109
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
109
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
109
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
109
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
109
    }
656
109
    _closed = true;
657
109
    return Status::OK();
658
109
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
735k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
735k
    if (_closed) {
651
16.7k
        return Status::OK();
652
16.7k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
719k
    _closed = true;
657
719k
    return Status::OK();
658
735k
}
_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
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4.96k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4.96k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4.96k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4.96k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4.96k
    }
656
4.96k
    _closed = true;
657
4.96k
    return Status::OK();
658
4.96k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
425
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
425
    if (_closed) {
651
213
        return Status::OK();
652
213
    }
653
212
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
212
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
212
    }
656
212
    _closed = true;
657
212
    return Status::OK();
658
425
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
11.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
11.1k
    if (_closed) {
651
5.71k
        return Status::OK();
652
5.71k
    }
653
5.42k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.42k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.42k
    }
656
5.42k
    _closed = true;
657
5.42k
    return Status::OK();
658
11.1k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
595k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
595k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
595k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
595k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
595k
    }
656
595k
    _closed = true;
657
595k
    return Status::OK();
658
595k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
337
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
337
    if (_closed) {
651
177
        return Status::OK();
652
177
    }
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
337
}
659
660
template <typename SharedState>
661
1.60M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.60M
    _operator_profile =
664
1.60M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.60M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.60M
    _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.60M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.60M
    _operator_profile->add_child(_common_profile, true);
673
1.60M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.60M
    _operator_profile->set_metadata(_parent->node_id());
676
1.60M
    _wait_for_finish_dependency_timer =
677
1.60M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.60M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.60M
    if constexpr (!is_fake_shared) {
680
1.13M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.13M
            info.shared_state_map.end()) {
682
305k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
224k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
224k
            }
685
305k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
305k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
305k
                                                  ? 0
688
305k
                                                  : info.task_idx]
689
305k
                                  .get();
690
305k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
831k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
831k
            _shared_state = info.shared_state->template cast<SharedState>();
696
831k
            _dependency = _shared_state->create_sink_dependency(
697
831k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
831k
        }
699
1.13M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.13M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.13M
    }
702
703
1.60M
    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.60M
    _rows_input_counter =
708
1.60M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.60M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.60M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.60M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.60M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.60M
    _memory_used_counter =
714
1.60M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.60M
    _common_profile->add_info_string("IsColocate",
716
1.60M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.60M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.60M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.60M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.60M
    return Status::OK();
721
1.60M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
115k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
115k
    _operator_profile =
664
115k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
115k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
115k
    _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
115k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
115k
    _operator_profile->add_child(_common_profile, true);
673
115k
    _operator_profile->add_child(_custom_profile, true);
674
675
115k
    _operator_profile->set_metadata(_parent->node_id());
676
115k
    _wait_for_finish_dependency_timer =
677
115k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
115k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
115k
    if constexpr (!is_fake_shared) {
680
115k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
115k
            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
14.3k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
14.3k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
14.3k
                                                  ? 0
688
14.3k
                                                  : info.task_idx]
689
14.3k
                                  .get();
690
14.3k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
100k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
100k
            _shared_state = info.shared_state->template cast<SharedState>();
696
100k
            _dependency = _shared_state->create_sink_dependency(
697
100k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
100k
        }
699
115k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
115k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
115k
    }
702
703
115k
    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
115k
    _rows_input_counter =
708
115k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
115k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
115k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
115k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
115k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
115k
    _memory_used_counter =
714
115k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
115k
    _common_profile->add_info_string("IsColocate",
716
115k
                                     std::to_string(_parent->is_colocated_operator()));
717
115k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
115k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
115k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
115k
    return Status::OK();
721
115k
}
_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
233k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
233k
    _operator_profile =
664
233k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
233k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
233k
    _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
233k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
233k
    _operator_profile->add_child(_common_profile, true);
673
233k
    _operator_profile->add_child(_custom_profile, true);
674
675
233k
    _operator_profile->set_metadata(_parent->node_id());
676
233k
    _wait_for_finish_dependency_timer =
677
233k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
233k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
233k
    if constexpr (!is_fake_shared) {
680
233k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
233k
            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
233k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
233k
            _shared_state = info.shared_state->template cast<SharedState>();
696
233k
            _dependency = _shared_state->create_sink_dependency(
697
233k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
233k
        }
699
233k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
233k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
233k
    }
702
703
233k
    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
233k
    _rows_input_counter =
708
233k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
233k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
233k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
233k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
233k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
233k
    _memory_used_counter =
714
233k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
233k
    _common_profile->add_info_string("IsColocate",
716
233k
                                     std::to_string(_parent->is_colocated_operator()));
717
233k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
233k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
233k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
233k
    return Status::OK();
721
233k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
33
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
33
    _operator_profile =
664
33
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
33
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
33
    _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
33
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
33
    _operator_profile->add_child(_common_profile, true);
673
33
    _operator_profile->add_child(_custom_profile, true);
674
675
33
    _operator_profile->set_metadata(_parent->node_id());
676
33
    _wait_for_finish_dependency_timer =
677
33
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
33
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
33
    if constexpr (!is_fake_shared) {
680
33
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
33
            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
33
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
33
            _shared_state = info.shared_state->template cast<SharedState>();
696
33
            _dependency = _shared_state->create_sink_dependency(
697
33
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
33
        }
699
33
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
33
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
33
    }
702
703
33
    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
33
    _rows_input_counter =
708
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
33
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
33
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
33
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
33
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
33
    _memory_used_counter =
714
33
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
33
    _common_profile->add_info_string("IsColocate",
716
33
                                     std::to_string(_parent->is_colocated_operator()));
717
33
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
33
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
33
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
33
    return Status::OK();
721
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.96k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.96k
    _operator_profile =
664
5.96k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.96k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.96k
    _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
5.96k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.96k
    _operator_profile->add_child(_common_profile, true);
673
5.96k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.96k
    _operator_profile->set_metadata(_parent->node_id());
676
5.96k
    _wait_for_finish_dependency_timer =
677
5.96k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.96k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.96k
    if constexpr (!is_fake_shared) {
680
5.96k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.96k
            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
5.96k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.96k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.96k
            _dependency = _shared_state->create_sink_dependency(
697
5.96k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.96k
        }
699
5.96k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.96k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.96k
    }
702
703
5.96k
    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
5.96k
    _rows_input_counter =
708
5.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.96k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.96k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.96k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.96k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.96k
    _memory_used_counter =
714
5.96k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.96k
    _common_profile->add_info_string("IsColocate",
716
5.96k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.96k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.96k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.96k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.96k
    return Status::OK();
721
5.96k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.39k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.39k
    _operator_profile =
664
8.39k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.39k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.39k
    _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.39k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.39k
    _operator_profile->add_child(_common_profile, true);
673
8.39k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.39k
    _operator_profile->set_metadata(_parent->node_id());
676
8.39k
    _wait_for_finish_dependency_timer =
677
8.39k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.39k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.39k
    if constexpr (!is_fake_shared) {
680
8.39k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.39k
            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.39k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.39k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.39k
            _dependency = _shared_state->create_sink_dependency(
697
8.39k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.39k
        }
699
8.39k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.39k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.39k
    }
702
703
8.39k
    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.39k
    _rows_input_counter =
708
8.39k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.39k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.39k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.39k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.39k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.39k
    _memory_used_counter =
714
8.39k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.39k
    _common_profile->add_info_string("IsColocate",
716
8.39k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.39k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.39k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.39k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.39k
    return Status::OK();
721
8.39k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
85.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
85.8k
    _operator_profile =
664
85.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
85.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
85.8k
    _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
85.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
85.8k
    _operator_profile->add_child(_common_profile, true);
673
85.8k
    _operator_profile->add_child(_custom_profile, true);
674
675
85.8k
    _operator_profile->set_metadata(_parent->node_id());
676
85.8k
    _wait_for_finish_dependency_timer =
677
85.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
85.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
85.8k
    if constexpr (!is_fake_shared) {
680
85.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
85.8k
            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
85.8k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
85.8k
            _shared_state = info.shared_state->template cast<SharedState>();
696
85.8k
            _dependency = _shared_state->create_sink_dependency(
697
85.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
85.8k
        }
699
85.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
85.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
85.8k
    }
702
703
85.8k
    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
85.8k
    _rows_input_counter =
708
85.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
85.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
85.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
85.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
85.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
85.8k
    _memory_used_counter =
714
85.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
85.8k
    _common_profile->add_info_string("IsColocate",
716
85.8k
                                     std::to_string(_parent->is_colocated_operator()));
717
85.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
85.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
85.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
85.8k
    return Status::OK();
721
85.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
66.6k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
66.6k
    _operator_profile =
664
66.6k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
66.6k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
66.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
66.6k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
66.6k
    _operator_profile->add_child(_common_profile, true);
673
66.6k
    _operator_profile->add_child(_custom_profile, true);
674
675
66.6k
    _operator_profile->set_metadata(_parent->node_id());
676
66.6k
    _wait_for_finish_dependency_timer =
677
66.6k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
66.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
66.6k
    if constexpr (!is_fake_shared) {
680
66.6k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
66.8k
            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
66.8k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
66.8k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
66.8k
                                                  ? 0
688
66.8k
                                                  : info.task_idx]
689
66.8k
                                  .get();
690
66.8k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
66.6k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
66.6k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
66.6k
    }
702
703
66.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
66.6k
    _rows_input_counter =
708
66.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
66.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
66.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
66.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
66.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
66.6k
    _memory_used_counter =
714
66.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
66.6k
    _common_profile->add_info_string("IsColocate",
716
66.6k
                                     std::to_string(_parent->is_colocated_operator()));
717
66.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
66.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
66.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
66.6k
    return Status::OK();
721
66.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
120
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
120
    _operator_profile =
664
120
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
120
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
120
    _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
120
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
120
    _operator_profile->add_child(_common_profile, true);
673
120
    _operator_profile->add_child(_custom_profile, true);
674
675
120
    _operator_profile->set_metadata(_parent->node_id());
676
120
    _wait_for_finish_dependency_timer =
677
120
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
120
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
120
    if constexpr (!is_fake_shared) {
680
120
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
120
            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
120
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
120
            _shared_state = info.shared_state->template cast<SharedState>();
696
120
            _dependency = _shared_state->create_sink_dependency(
697
120
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
120
        }
699
120
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
120
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
120
    }
702
703
120
    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
120
    _rows_input_counter =
708
120
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
120
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
120
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
120
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
120
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
120
    _memory_used_counter =
714
120
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
120
    _common_profile->add_info_string("IsColocate",
716
120
                                     std::to_string(_parent->is_colocated_operator()));
717
120
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
120
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
120
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
120
    return Status::OK();
721
120
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
469k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
469k
    _operator_profile =
664
469k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
469k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
469k
    _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
469k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
469k
    _operator_profile->add_child(_common_profile, true);
673
469k
    _operator_profile->add_child(_custom_profile, true);
674
675
469k
    _operator_profile->set_metadata(_parent->node_id());
676
469k
    _wait_for_finish_dependency_timer =
677
469k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
469k
    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
469k
    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
469k
    _rows_input_counter =
708
469k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
469k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
469k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
469k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
469k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
469k
    _memory_used_counter =
714
469k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
469k
    _common_profile->add_info_string("IsColocate",
716
469k
                                     std::to_string(_parent->is_colocated_operator()));
717
469k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
469k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
469k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
469k
    return Status::OK();
721
469k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
9.51k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
9.51k
    _operator_profile =
664
9.51k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
9.51k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
9.51k
    _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.51k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
9.51k
    _operator_profile->add_child(_common_profile, true);
673
9.51k
    _operator_profile->add_child(_custom_profile, true);
674
675
9.51k
    _operator_profile->set_metadata(_parent->node_id());
676
9.51k
    _wait_for_finish_dependency_timer =
677
9.51k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
9.51k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
9.51k
    if constexpr (!is_fake_shared) {
680
9.51k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
9.51k
            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.51k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
9.51k
            _shared_state = info.shared_state->template cast<SharedState>();
696
9.51k
            _dependency = _shared_state->create_sink_dependency(
697
9.51k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
9.51k
        }
699
9.51k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
9.51k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
9.51k
    }
702
703
9.51k
    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.51k
    _rows_input_counter =
708
9.51k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
9.51k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
9.51k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
9.51k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
9.51k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
9.51k
    _memory_used_counter =
714
9.51k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
9.51k
    _common_profile->add_info_string("IsColocate",
716
9.51k
                                     std::to_string(_parent->is_colocated_operator()));
717
9.51k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
9.51k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
9.51k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
9.51k
    return Status::OK();
721
9.51k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
315
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
315
    _operator_profile =
664
315
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
315
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
315
    _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
315
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
315
    _operator_profile->add_child(_common_profile, true);
673
315
    _operator_profile->add_child(_custom_profile, true);
674
675
315
    _operator_profile->set_metadata(_parent->node_id());
676
315
    _wait_for_finish_dependency_timer =
677
315
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
315
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
315
    if constexpr (!is_fake_shared) {
680
315
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
315
            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
315
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
315
            _shared_state = info.shared_state->template cast<SharedState>();
696
315
            _dependency = _shared_state->create_sink_dependency(
697
315
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
315
        }
699
315
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
315
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
315
    }
702
703
315
    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
315
    _rows_input_counter =
708
315
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
315
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
315
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
315
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
315
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
315
    _memory_used_counter =
714
315
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
315
    _common_profile->add_info_string("IsColocate",
716
315
                                     std::to_string(_parent->is_colocated_operator()));
717
315
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
315
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
315
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
315
    return Status::OK();
721
315
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
1.97k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.97k
    _operator_profile =
664
1.97k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.97k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.97k
    _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.97k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.97k
    _operator_profile->add_child(_common_profile, true);
673
1.97k
    _operator_profile->add_child(_custom_profile, true);
674
675
1.97k
    _operator_profile->set_metadata(_parent->node_id());
676
1.97k
    _wait_for_finish_dependency_timer =
677
1.97k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.97k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.97k
    if constexpr (!is_fake_shared) {
680
1.97k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.97k
            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
1.97k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
1.97k
            _shared_state = info.shared_state->template cast<SharedState>();
696
1.97k
            _dependency = _shared_state->create_sink_dependency(
697
1.97k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
1.97k
        }
699
1.97k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.97k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.97k
    }
702
703
1.97k
    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.97k
    _rows_input_counter =
708
1.97k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.97k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.97k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.97k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.97k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.97k
    _memory_used_counter =
714
1.97k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.97k
    _common_profile->add_info_string("IsColocate",
716
1.97k
                                     std::to_string(_parent->is_colocated_operator()));
717
1.97k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.97k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.97k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.97k
    return Status::OK();
721
1.97k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
13.2k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
13.2k
    _operator_profile =
664
13.2k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
13.2k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
13.2k
    _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.2k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
13.2k
    _operator_profile->add_child(_common_profile, true);
673
13.2k
    _operator_profile->add_child(_custom_profile, true);
674
675
13.2k
    _operator_profile->set_metadata(_parent->node_id());
676
13.2k
    _wait_for_finish_dependency_timer =
677
13.2k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
13.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
13.2k
    if constexpr (!is_fake_shared) {
680
13.2k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
13.2k
            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.2k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
13.2k
            _shared_state = info.shared_state->template cast<SharedState>();
696
13.2k
            _dependency = _shared_state->create_sink_dependency(
697
13.2k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
13.2k
        }
699
13.2k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
13.2k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
13.2k
    }
702
703
13.2k
    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.2k
    _rows_input_counter =
708
13.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
13.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
13.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
13.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
13.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
13.2k
    _memory_used_counter =
714
13.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
13.2k
    _common_profile->add_info_string("IsColocate",
716
13.2k
                                     std::to_string(_parent->is_colocated_operator()));
717
13.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
13.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
13.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
13.2k
    return Status::OK();
721
13.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
224k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
224k
    _operator_profile =
664
224k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
224k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
224k
    _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
224k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
224k
    _operator_profile->add_child(_common_profile, true);
673
224k
    _operator_profile->add_child(_custom_profile, true);
674
675
224k
    _operator_profile->set_metadata(_parent->node_id());
676
224k
    _wait_for_finish_dependency_timer =
677
224k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
224k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
224k
    if constexpr (!is_fake_shared) {
680
224k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
224k
            info.shared_state_map.end()) {
682
224k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
224k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
224k
            }
685
224k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
224k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
224k
                                                  ? 0
688
224k
                                                  : info.task_idx]
689
224k
                                  .get();
690
224k
            _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
224k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
224k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
224k
    }
702
703
224k
    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
224k
    _rows_input_counter =
708
224k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
224k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
224k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
224k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
224k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
224k
    _memory_used_counter =
714
224k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
224k
    _common_profile->add_info_string("IsColocate",
716
224k
                                     std::to_string(_parent->is_colocated_operator()));
717
224k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
224k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
224k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
224k
    return Status::OK();
721
224k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
372k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
372k
    _operator_profile =
664
372k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
372k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
372k
    _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
372k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
372k
    _operator_profile->add_child(_common_profile, true);
673
372k
    _operator_profile->add_child(_custom_profile, true);
674
675
372k
    _operator_profile->set_metadata(_parent->node_id());
676
372k
    _wait_for_finish_dependency_timer =
677
372k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
372k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
372k
    if constexpr (!is_fake_shared) {
680
372k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
372k
            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
372k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
372k
            _shared_state = info.shared_state->template cast<SharedState>();
696
372k
            _dependency = _shared_state->create_sink_dependency(
697
372k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
372k
        }
699
372k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
372k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
372k
    }
702
703
372k
    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
372k
    _rows_input_counter =
708
372k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
372k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
372k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
372k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
372k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
372k
    _memory_used_counter =
714
372k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
372k
    _common_profile->add_info_string("IsColocate",
716
372k
                                     std::to_string(_parent->is_colocated_operator()));
717
372k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
372k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
372k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
372k
    return Status::OK();
721
372k
}
_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.61M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.61M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.61M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.13M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.13M
    }
731
1.61M
    _closed = true;
732
1.61M
    return Status::OK();
733
1.61M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
115k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
115k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
115k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
115k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
115k
    }
731
115k
    _closed = true;
732
115k
    return Status::OK();
733
115k
}
_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
234k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
234k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
234k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
234k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
234k
    }
731
234k
    _closed = true;
732
234k
    return Status::OK();
733
234k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
24
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
24
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
22
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
22
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
22
    }
731
22
    _closed = true;
732
22
    return Status::OK();
733
24
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.96k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.96k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.96k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.96k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.96k
    }
731
5.96k
    _closed = true;
732
5.96k
    return Status::OK();
733
5.96k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.39k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.39k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.39k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.39k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.39k
    }
731
8.39k
    _closed = true;
732
8.39k
    return Status::OK();
733
8.39k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
85.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
85.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
85.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
85.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
85.6k
    }
731
85.6k
    _closed = true;
732
85.6k
    return Status::OK();
733
85.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
66.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
66.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
66.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
66.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
66.4k
    }
731
66.4k
    _closed = true;
732
66.4k
    return Status::OK();
733
66.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
109
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
109
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
109
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
109
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
109
    }
731
109
    _closed = true;
732
109
    return Status::OK();
733
109
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
475k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
475k
    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
475k
    _closed = true;
732
475k
    return Status::OK();
733
475k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
9.50k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
9.50k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
9.50k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
9.50k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
9.50k
    }
731
9.50k
    _closed = true;
732
9.50k
    return Status::OK();
733
9.50k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
211
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
211
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
211
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
211
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
211
    }
731
211
    _closed = true;
732
211
    return Status::OK();
733
211
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1.98k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.98k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1.98k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.98k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.98k
    }
731
1.98k
    _closed = true;
732
1.98k
    return Status::OK();
733
1.98k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
13.2k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
13.2k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
13.2k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
13.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
13.2k
    }
731
13.2k
    _closed = true;
732
13.2k
    return Status::OK();
733
13.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
225k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
225k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
225k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
225k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
225k
    }
731
225k
    _closed = true;
732
225k
    return Status::OK();
733
225k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
373k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
373k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
373k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
373k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
373k
    }
731
373k
    _closed = true;
732
373k
    return Status::OK();
733
373k
}
_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.70k
                                                          bool* eos) {
738
4.70k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.69k
    return pull(state, block, eos);
740
4.70k
}
_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.66k
                                                          bool* eos) {
738
4.66k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.65k
    return pull(state, block, eos);
740
4.66k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
435k
                                                         bool* eos) {
745
435k
    auto& local_state = get_local_state(state);
746
435k
    if (need_more_input_data(state)) {
747
402k
        local_state._child_block->clear_column_data(
748
402k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
402k
                        .num_materialized_slots());
750
402k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
402k
                state, local_state._child_block.get(), &local_state._child_eos));
752
402k
        *eos = local_state._child_eos;
753
402k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
55.8k
            return Status::OK();
755
55.8k
        }
756
346k
        {
757
346k
            SCOPED_TIMER(local_state.exec_time_counter());
758
346k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
346k
        }
760
346k
    }
761
762
379k
    if (!need_more_input_data(state)) {
763
355k
        SCOPED_TIMER(local_state.exec_time_counter());
764
355k
        bool new_eos = false;
765
355k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
355k
        if (new_eos) {
767
276k
            *eos = true;
768
276k
        } else if (!need_more_input_data(state)) {
769
26.3k
            *eos = false;
770
26.3k
        }
771
355k
    }
772
379k
    return Status::OK();
773
379k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
131k
                                                         bool* eos) {
745
131k
    auto& local_state = get_local_state(state);
746
131k
    if (need_more_input_data(state)) {
747
112k
        local_state._child_block->clear_column_data(
748
112k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
112k
                        .num_materialized_slots());
750
112k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
112k
                state, local_state._child_block.get(), &local_state._child_eos));
752
112k
        *eos = local_state._child_eos;
753
112k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
29.6k
            return Status::OK();
755
29.6k
        }
756
82.4k
        {
757
82.4k
            SCOPED_TIMER(local_state.exec_time_counter());
758
82.4k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
82.4k
        }
760
82.4k
    }
761
762
101k
    if (!need_more_input_data(state)) {
763
101k
        SCOPED_TIMER(local_state.exec_time_counter());
764
101k
        bool new_eos = false;
765
101k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
101k
        if (new_eos) {
767
43.0k
            *eos = true;
768
58.5k
        } else if (!need_more_input_data(state)) {
769
11.7k
            *eos = false;
770
11.7k
        }
771
101k
    }
772
101k
    return Status::OK();
773
101k
}
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.54k
        local_state._child_block->clear_column_data(
748
2.54k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.54k
                        .num_materialized_slots());
750
2.54k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.54k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.54k
        *eos = local_state._child_eos;
753
2.54k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
464
            return Status::OK();
755
464
        }
756
2.08k
        {
757
2.08k
            SCOPED_TIMER(local_state.exec_time_counter());
758
2.08k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
2.08k
        }
760
2.08k
    }
761
762
4.17k
    if (!need_more_input_data(state)) {
763
4.17k
        SCOPED_TIMER(local_state.exec_time_counter());
764
4.17k
        bool new_eos = false;
765
4.17k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
4.17k
        if (new_eos) {
767
1.51k
            *eos = true;
768
2.65k
        } else if (!need_more_input_data(state)) {
769
2.06k
            *eos = false;
770
2.06k
        }
771
4.17k
    }
772
4.14k
    return Status::OK();
773
4.14k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.91k
                                                         bool* eos) {
745
1.91k
    auto& local_state = get_local_state(state);
746
1.91k
    if (need_more_input_data(state)) {
747
1.91k
        local_state._child_block->clear_column_data(
748
1.91k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.91k
                        .num_materialized_slots());
750
1.91k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.91k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.91k
        *eos = local_state._child_eos;
753
1.91k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
777
            return Status::OK();
755
777
        }
756
1.13k
        {
757
1.13k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.13k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.13k
        }
760
1.13k
    }
761
762
1.13k
    if (!need_more_input_data(state)) {
763
1.13k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.13k
        bool new_eos = false;
765
1.13k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.13k
        if (new_eos) {
767
786
            *eos = true;
768
786
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.13k
    }
772
1.13k
    return Status::OK();
773
1.13k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
15.1k
                                                         bool* eos) {
745
15.1k
    auto& local_state = get_local_state(state);
746
15.1k
    if (need_more_input_data(state)) {
747
15.1k
        local_state._child_block->clear_column_data(
748
15.1k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
15.1k
                        .num_materialized_slots());
750
15.1k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
15.1k
                state, local_state._child_block.get(), &local_state._child_eos));
752
15.1k
        *eos = local_state._child_eos;
753
15.1k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
3.79k
            return Status::OK();
755
3.79k
        }
756
11.3k
        {
757
11.3k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.3k
        }
760
11.3k
    }
761
762
11.3k
    if (!need_more_input_data(state)) {
763
6.57k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.57k
        bool new_eos = false;
765
6.57k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.57k
        if (new_eos) {
767
6.49k
            *eos = true;
768
6.49k
        } else if (!need_more_input_data(state)) {
769
13
            *eos = false;
770
13
        }
771
6.57k
    }
772
11.3k
    return Status::OK();
773
11.3k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
251k
                                                         bool* eos) {
745
251k
    auto& local_state = get_local_state(state);
746
251k
    if (need_more_input_data(state)) {
747
251k
        local_state._child_block->clear_column_data(
748
251k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
251k
                        .num_materialized_slots());
750
251k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
251k
                state, local_state._child_block.get(), &local_state._child_eos));
752
251k
        *eos = local_state._child_eos;
753
251k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
19.2k
            return Status::OK();
755
19.2k
        }
756
232k
        {
757
232k
            SCOPED_TIMER(local_state.exec_time_counter());
758
232k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
232k
        }
760
232k
    }
761
762
232k
    if (!need_more_input_data(state)) {
763
213k
        SCOPED_TIMER(local_state.exec_time_counter());
764
213k
        bool new_eos = false;
765
213k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
213k
        if (new_eos) {
767
212k
            *eos = true;
768
212k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
213k
    }
772
232k
    return Status::OK();
773
232k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
22.4k
                                                         bool* eos) {
745
22.4k
    auto& local_state = get_local_state(state);
746
22.4k
    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
590
            return Status::OK();
755
590
        }
756
9.80k
        {
757
9.80k
            SCOPED_TIMER(local_state.exec_time_counter());
758
9.80k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
9.80k
        }
760
9.80k
    }
761
762
21.8k
    if (!need_more_input_data(state)) {
763
21.3k
        SCOPED_TIMER(local_state.exec_time_counter());
764
21.3k
        bool new_eos = false;
765
21.3k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
21.3k
        if (new_eos) {
767
5.95k
            *eos = true;
768
15.3k
        } else if (!need_more_input_data(state)) {
769
12.0k
            *eos = false;
770
12.0k
        }
771
21.3k
    }
772
21.8k
    return Status::OK();
773
21.8k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
8.72k
                                                         bool* eos) {
745
8.72k
    auto& local_state = get_local_state(state);
746
8.72k
    if (need_more_input_data(state)) {
747
8.36k
        local_state._child_block->clear_column_data(
748
8.36k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
8.36k
                        .num_materialized_slots());
750
8.36k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
8.36k
                state, local_state._child_block.get(), &local_state._child_eos));
752
8.36k
        *eos = local_state._child_eos;
753
8.36k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.29k
            return Status::OK();
755
1.29k
        }
756
7.06k
        {
757
7.06k
            SCOPED_TIMER(local_state.exec_time_counter());
758
7.06k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
7.06k
        }
760
7.06k
    }
761
762
7.43k
    if (!need_more_input_data(state)) {
763
7.43k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.43k
        bool new_eos = false;
765
7.43k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.43k
        if (new_eos) {
767
5.35k
            *eos = true;
768
5.35k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
7.43k
    }
772
7.42k
    return Status::OK();
773
7.42k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
46.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.7k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.7k
                                                         "AsyncWriterDependency", true);
781
46.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.7k
                             _finish_dependency));
783
784
46.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.7k
    return Status::OK();
787
46.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
378
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
378
    RETURN_IF_ERROR(Base::init(state, info));
779
378
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
378
                                                         "AsyncWriterDependency", true);
781
378
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
378
                             _finish_dependency));
783
784
378
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
378
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
378
    return Status::OK();
787
378
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
46.3k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.3k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.3k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.3k
                                                         "AsyncWriterDependency", true);
781
46.3k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.3k
                             _finish_dependency));
783
784
46.3k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.3k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.3k
    return Status::OK();
787
46.3k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
38
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
38
    RETURN_IF_ERROR(Base::init(state, info));
779
38
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
38
                                                         "AsyncWriterDependency", true);
781
38
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
38
                             _finish_dependency));
783
784
38
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
38
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
38
    return Status::OK();
787
38
}
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
47.4k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.4k
    RETURN_IF_ERROR(Base::open(state));
793
47.4k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
378k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
331k
        RETURN_IF_ERROR(
796
331k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
331k
    }
798
47.4k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.4k
    return Status::OK();
800
47.4k
}
_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.91k
    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
46.9k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.9k
    RETURN_IF_ERROR(Base::open(state));
793
46.9k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
376k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
329k
        RETURN_IF_ERROR(
796
329k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
329k
    }
798
46.9k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.9k
    return Status::OK();
800
46.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
38
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
38
    RETURN_IF_ERROR(Base::open(state));
793
38
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
684
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
646
        RETURN_IF_ERROR(
796
646
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
646
    }
798
38
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
38
    return Status::OK();
800
38
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
62.2k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.2k
    return _writer->sink(block, eos);
806
62.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.10k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.10k
    return _writer->sink(block, eos);
806
1.10k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
61.1k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.1k
    return _writer->sink(block, eos);
806
61.1k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
38
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
38
    return _writer->sink(block, eos);
806
38
}
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
47.4k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.4k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.4k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.4k
    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
47.5k
    if (_writer) {
818
47.5k
        Status st = _writer->get_writer_status();
819
47.5k
        if (exec_status.ok()) {
820
47.4k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.4k
                                                       : Status::Cancelled("force close"));
822
47.4k
        } else {
823
61
            _writer->force_close(exec_status);
824
61
        }
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
47.5k
        RETURN_IF_ERROR(st);
829
47.5k
    }
830
47.4k
    return Base::close(state, exec_status);
831
47.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
365
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
365
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
365
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
365
    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
365
    if (_writer) {
818
365
        Status st = _writer->get_writer_status();
819
365
        if (exec_status.ok()) {
820
365
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
365
                                                       : Status::Cancelled("force close"));
822
365
        } 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
365
        RETURN_IF_ERROR(st);
829
365
    }
830
365
    return Base::close(state, exec_status);
831
365
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
47.0k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.0k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.0k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.0k
    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
47.1k
    if (_writer) {
818
47.1k
        Status st = _writer->get_writer_status();
819
47.1k
        if (exec_status.ok()) {
820
47.0k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.0k
                                                       : Status::Cancelled("force close"));
822
47.0k
        } else {
823
61
            _writer->force_close(exec_status);
824
61
        }
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
47.1k
        RETURN_IF_ERROR(st);
829
47.1k
    }
830
47.0k
    return Base::close(state, exec_status);
831
47.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
38
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
38
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
38
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
38
    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
38
    if (_writer) {
818
38
        Status st = _writer->get_writer_status();
819
38
        if (exec_status.ok()) {
820
38
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
38
                                                       : Status::Cancelled("force close"));
822
38
        } 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
38
        RETURN_IF_ERROR(st);
829
38
    }
830
38
    return Base::close(state, exec_status);
831
38
}
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