Coverage Report

Created: 2026-08-31 16:10

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.67M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.67M
    if (_parent->nereids_id() == -1) {
122
877k
        return fmt::format("(id={})", _parent->node_id());
123
877k
    } else {
124
800k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
800k
    }
126
1.67M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
68.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
68.0k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
68.0k
    } else {
124
68.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
68.0k
    }
126
68.0k
}
_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
151k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
151k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
151k
    } else {
124
151k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
151k
    }
126
151k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
23
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
23
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
23
    } else {
124
23
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
23
    }
126
23
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.81k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.81k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.81k
    } else {
124
5.81k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.81k
    }
126
5.81k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
7.65k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
7.65k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
7.64k
    } else {
124
7.64k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7.64k
    }
126
7.65k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
83.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
83.6k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
83.6k
    } else {
124
83.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
83.6k
    }
126
83.6k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
84.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
84.8k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
84.8k
    } else {
124
84.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
84.8k
    }
126
84.8k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
22
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
22
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
22
    } else {
124
22
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
22
    }
126
22
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
625k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
625k
    if (_parent->nereids_id() == -1) {
122
281k
        return fmt::format("(id={})", _parent->node_id());
123
344k
    } else {
124
344k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
344k
    }
126
625k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
50.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
50.8k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
50.8k
    } else {
124
50.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
50.8k
    }
126
50.8k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
24
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
25
    if (_parent->nereids_id() == -1) {
122
25
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
24
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.00k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.00k
    if (_parent->nereids_id() == -1) {
122
6.00k
        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
6.00k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
424
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
424
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
322
    } else {
124
322
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
322
    }
126
424
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.82k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.82k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
4.81k
    } else {
124
4.81k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4.81k
    }
126
4.82k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
588k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
589k
    if (_parent->nereids_id() == -1) {
122
589k
        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
588k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
164
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
164
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
164
    } else {
124
164
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
164
    }
126
164
}
127
128
template <typename SharedStateArg>
129
1.13M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.13M
    if (_parent->nereids_id() == -1) {
131
675k
        return fmt::format("(id={})", _parent->node_id());
132
675k
    } else {
133
458k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
458k
    }
135
1.13M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
116k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
116k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
116k
    } else {
133
116k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
116k
    }
135
116k
}
_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
154k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
154k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
154k
    } else {
133
154k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
154k
    }
135
154k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
30
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
30
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
30
    } else {
133
30
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
30
    }
135
30
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.94k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.94k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.94k
    } else {
133
5.94k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.94k
    }
135
5.94k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.71k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.71k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
7.70k
    } else {
133
7.70k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.70k
    }
135
7.71k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
84.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
84.5k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
84.4k
    } else {
133
84.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
84.4k
    }
135
84.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
84.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
84.3k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
84.3k
    } else {
133
84.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
84.3k
    }
135
84.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
32
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
32
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
32
    } else {
133
32
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
32
    }
135
32
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
24
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
24
    if (_parent->nereids_id() == -1) {
131
24
        return fmt::format("(id={})", _parent->node_id());
132
24
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
24
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.36k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.36k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
5.36k
    } else {
133
5.36k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.36k
    }
135
5.36k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
424
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
424
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
322
    } else {
133
322
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
322
    }
135
424
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.6k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.6k
    if (_parent->nereids_id() == -1) {
131
12.6k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
236k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
236k
    if (_parent->nereids_id() == -1) {
131
236k
        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
236k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
425k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
425k
    if (_parent->nereids_id() == -1) {
131
425k
        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
425k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
23
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        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
23
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
328
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
328
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
328
    } else {
133
328
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
328
    }
135
328
}
136
137
template <typename SharedStateArg>
138
29.6k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.6k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
29.6k
    _terminated = true;
143
29.6k
    return Status::OK();
144
29.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.92k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.92k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.92k
    _terminated = true;
143
1.92k
    return Status::OK();
144
1.92k
}
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
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.73k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.73k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.73k
    _terminated = true;
143
1.73k
    return Status::OK();
144
1.73k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
659
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
659
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
659
    _terminated = true;
143
659
    return Status::OK();
144
659
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
765
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
765
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
765
    _terminated = true;
143
765
    return Status::OK();
144
765
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
46
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
46
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
46
    _terminated = true;
143
46
    return Status::OK();
144
46
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
4
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
4
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
4
    _terminated = true;
143
4
    return Status::OK();
144
4
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
134
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
134
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
134
    _terminated = true;
143
134
    return Status::OK();
144
134
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
18
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
18
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
18
    _terminated = true;
143
18
    return Status::OK();
144
18
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
224
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
224
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
224
    _terminated = true;
143
224
    return Status::OK();
144
224
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
133
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
133
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
133
    _terminated = true;
143
133
    return Status::OK();
144
133
}
145
146
280k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
280k
    return _child && _child->is_serial_operator() && !is_source()
148
280k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
280k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
280k
}
151
152
20.2k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
20.2k
    if (!_child) {
154
19.2k
        return false;
155
19.2k
    }
156
998
    if (_child->is_serial_operator()) {
157
108
        return true;
158
108
    }
159
890
    const auto child_distribution = _child->required_data_distribution(state);
160
890
    return child_distribution.need_local_exchange() &&
161
890
           !is_shuffled_exchange(child_distribution.distribution_type);
162
998
}
163
164
template <typename SharedStateArg>
165
19.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.5k
    fmt::memory_buffer debug_string_buffer;
167
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.5k
    return fmt::to_string(debug_string_buffer);
169
19.5k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
19.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.5k
    fmt::memory_buffer debug_string_buffer;
167
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.5k
    return fmt::to_string(debug_string_buffer);
169
19.5k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
19.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.5k
    fmt::memory_buffer debug_string_buffer;
174
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.5k
    return fmt::to_string(debug_string_buffer);
176
19.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
19.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.5k
    fmt::memory_buffer debug_string_buffer;
174
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.5k
    return fmt::to_string(debug_string_buffer);
176
19.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
19.6k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
19.6k
    fmt::memory_buffer debug_string_buffer;
180
19.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
19.6k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
19.6k
                   _is_serial_operator);
183
19.6k
    return fmt::to_string(debug_string_buffer);
184
19.6k
}
185
186
19.5k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
19.5k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
19.5k
}
189
190
602k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
602k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
602k
    _nereids_id = tnode.nereids_id;
193
602k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.20k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.20k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.20k
            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.20k
    }
206
602k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
602k
    _op_name = substr + "_OPERATOR";
208
209
602k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
602k
    } else if (tnode.__isset.conjuncts) {
212
253k
        for (const auto& conjunct : tnode.conjuncts) {
213
253k
            VExprContextSPtr context;
214
253k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
253k
            _conjuncts.emplace_back(context);
216
253k
        }
217
86.2k
    }
218
219
    // create the projections expr
220
602k
    if (tnode.__isset.projections) {
221
234k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
234k
    }
223
602k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.20k
        DCHECK(has_projection()) << "no final projections";
225
3.20k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
4.18k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
4.18k
            VExprContextSPtrs projections;
228
4.18k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
4.18k
            _projection->intermediate_projections.push_back(projections);
230
4.18k
        }
231
3.20k
    }
232
602k
    return Status::OK();
233
602k
}
234
235
629k
Status OperatorXBase::prepare(RuntimeState* state) {
236
629k
    for (auto& conjunct : _conjuncts) {
237
253k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
253k
    }
239
629k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
578k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
327k
            return a->execute_cost() < b->execute_cost();
242
327k
        });
243
578k
    };
244
245
629k
    if (has_projection()) {
246
234k
        auto& projection = *_projection;
247
238k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
4.18k
            const auto& input_row_desc =
249
4.18k
                    i == 0 ? operator_row_desc_before_projection()
250
4.18k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
4.18k
            RETURN_IF_ERROR(
252
4.18k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
4.18k
        }
254
234k
        const auto& final_projection_input_row_desc =
255
234k
                projection.intermediate_output_row_descriptors.empty()
256
234k
                        ? operator_row_desc_before_projection()
257
234k
                        : projection.intermediate_output_row_descriptors.back();
258
234k
        RETURN_IF_ERROR(
259
234k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
234k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
234k
                                                      projection.output_row_descriptor));
262
234k
    }
263
264
629k
    for (auto& conjunct : _conjuncts) {
265
253k
        RETURN_IF_ERROR(conjunct->open(state));
266
253k
    }
267
629k
    if (has_projection()) {
268
234k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
234k
        for (auto& projections : _projection->intermediate_projections) {
270
4.18k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
4.18k
        }
272
234k
    }
273
629k
    if (_child && !is_source()) {
274
95.7k
        RETURN_IF_ERROR(_child->prepare(state));
275
95.7k
    }
276
277
629k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
629k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
629k
    return Status::OK();
283
629k
}
284
285
6.26k
Status OperatorXBase::terminate(RuntimeState* state) {
286
6.26k
    if (_child && !is_source()) {
287
593
        RETURN_IF_ERROR(_child->terminate(state));
288
593
    }
289
6.26k
    auto result = state->get_local_state_result(operator_id());
290
6.26k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
6.26k
    return result.value()->terminate(state);
294
6.26k
}
295
296
4.66M
Status OperatorXBase::close(RuntimeState* state) {
297
4.66M
    if (_child && !is_source()) {
298
832k
        RETURN_IF_ERROR(_child->close(state));
299
832k
    }
300
4.66M
    auto result = state->get_local_state_result(operator_id());
301
4.66M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.66M
    return result.value()->close(state);
305
4.66M
}
306
307
260k
void PipelineXLocalStateBase::clear_origin_block() {
308
260k
    _origin_block.clear_column_data(
309
260k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
260k
}
311
312
904k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
904k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
904k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
904k
    return Status::OK();
317
904k
}
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
260k
                                     Block* output_block) const {
326
260k
    auto* local_state = state->get_local_state(operator_id());
327
260k
    SCOPED_TIMER(local_state->exec_time_counter());
328
260k
    SCOPED_TIMER(local_state->_projection_timer);
329
260k
    const size_t rows = origin_block->rows();
330
260k
    if (rows == 0) {
331
138k
        return Status::OK();
332
138k
    }
333
121k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
121k
    {
336
121k
        Block input_block = *origin_block;
337
338
121k
        ColumnsWithTypeAndName new_columns;
339
121k
        for (const auto& projections : local_state->_intermediate_projections) {
340
1.42k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
1.42k
            new_columns.resize(projections.size());
345
8.92k
            for (int i = 0; i < projections.size(); i++) {
346
7.50k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
7.50k
                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
7.50k
            }
355
1.42k
            Block tmp_block {new_columns};
356
1.42k
            input_block.swap(tmp_block);
357
1.42k
        }
358
359
121k
        if (input_block.rows() != rows) {
360
0
            return Status::InternalError(
361
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
362
0
                    "input_block: {}",
363
0
                    input_block.rows(), rows, input_block.dump_structure());
364
0
        }
365
366
121k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
121k
                output_block, _projection->output_row_descriptor);
368
121k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
121k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
121k
        Columns shared_columns(mutable_columns.size());
371
372
670k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
548k
            ColumnPtr column_ptr;
374
548k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
548k
            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
548k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
548k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
548k
            if (column_ptr->is_exclusive()) {
386
195k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
353k
            } else {
388
353k
                shared_columns[i] = std::move(column_ptr);
389
353k
            }
390
548k
        }
391
392
121k
        scoped_mutable_block.restore();
393
670k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
548k
            if (shared_columns[i]) {
395
353k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
353k
            }
397
548k
        }
398
121k
    }
399
400
0
    origin_block->clear_column_data(
401
121k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
121k
    DCHECK_EQ(output_block->rows(), rows);
403
404
121k
    return Status::OK();
405
121k
}
406
407
4.43M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.43M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.43M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.43M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.43M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.43M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.43M
            if (_debug_point_count++ % 2 == 0) {
414
4.43M
                return Status::OK();
415
4.43M
            }
416
4.43M
        }
417
4.43M
    });
418
419
4.43M
    Status status;
420
4.43M
    auto* local_state = state->get_local_state(operator_id());
421
4.43M
    Defer defer([&]() {
422
4.43M
        if (status.ok()) {
423
4.43M
            local_state->update_output_block_counters(*block);
424
4.43M
        }
425
4.43M
    });
426
4.43M
    if (has_projection()) {
427
260k
        local_state->clear_origin_block();
428
260k
        status = get_block(state, &local_state->_origin_block, eos);
429
260k
        if (UNLIKELY(!status.ok())) {
430
25
            return status;
431
25
        }
432
260k
        status = do_projections(state, &local_state->_origin_block, block);
433
260k
        return status;
434
260k
    }
435
4.17M
    status = get_block(state, block, eos);
436
4.17M
    RETURN_IF_ERROR(block->check_type_and_column());
437
4.17M
    return status;
438
4.17M
}
439
440
2.69M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.69M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
3.39k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
3.39k
        *eos = true;
444
3.39k
    }
445
446
2.69M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.69M
        auto op_name = to_lower(_parent->_op_name);
448
2.69M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.69M
        arg_op_name = to_lower(arg_op_name);
450
451
2.69M
        if (op_name == arg_op_name) {
452
2.69M
            *eos = true;
453
2.69M
        }
454
2.69M
    });
455
456
2.69M
    if (auto rows = block->rows()) {
457
696k
        _num_rows_returned += rows;
458
696k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
696k
    }
460
2.69M
}
461
462
29.6k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
29.6k
    auto result = state->get_sink_local_state_result();
464
29.6k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
29.6k
    return result.value()->terminate(state);
468
29.6k
}
469
470
19.5k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
19.5k
    fmt::memory_buffer debug_string_buffer;
472
473
19.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
19.5k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
19.5k
    return fmt::to_string(debug_string_buffer);
476
19.5k
}
477
478
19.5k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
19.5k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
19.5k
}
481
482
313k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
313k
    std::string op_name = "UNKNOWN_SINK";
484
313k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
313k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
313k
        op_name = it->second;
488
313k
    }
489
313k
    _name = op_name + "_OPERATOR";
490
313k
    return Status::OK();
491
313k
}
492
493
267k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
267k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
267k
    _nereids_id = tnode.nereids_id;
496
267k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
267k
    _name = substr + "_SINK_OPERATOR";
498
267k
    return Status::OK();
499
267k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.58M
                                                            LocalSinkStateInfo& info) {
504
1.58M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.58M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.58M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.58M
    return Status::OK();
508
1.58M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
117k
                                                            LocalSinkStateInfo& info) {
504
117k
    auto local_state = LocalStateType::create_unique(this, state);
505
117k
    RETURN_IF_ERROR(local_state->init(state, info));
506
117k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
117k
    return Status::OK();
508
117k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
384k
                                                            LocalSinkStateInfo& info) {
504
384k
    auto local_state = LocalStateType::create_unique(this, state);
505
384k
    RETURN_IF_ERROR(local_state->init(state, info));
506
384k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
384k
    return Status::OK();
508
384k
}
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
353
                                                            LocalSinkStateInfo& info) {
504
353
    auto local_state = LocalStateType::create_unique(this, state);
505
353
    RETURN_IF_ERROR(local_state->init(state, info));
506
353
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
353
    return Status::OK();
508
353
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
43.5k
                                                            LocalSinkStateInfo& info) {
504
43.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
43.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
43.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
43.5k
    return Status::OK();
508
43.5k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
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
7.72k
                                                            LocalSinkStateInfo& info) {
504
7.72k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.72k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.72k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.72k
    return Status::OK();
508
7.72k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
21
                                                            LocalSinkStateInfo& info) {
504
21
    auto local_state = LocalStateType::create_unique(this, state);
505
21
    RETURN_IF_ERROR(local_state->init(state, info));
506
21
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
21
    return Status::OK();
508
21
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
155k
                                                            LocalSinkStateInfo& info) {
504
155k
    auto local_state = LocalStateType::create_unique(this, state);
505
155k
    RETURN_IF_ERROR(local_state->init(state, info));
506
155k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
155k
    return Status::OK();
508
155k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
30
                                                            LocalSinkStateInfo& info) {
504
30
    auto local_state = LocalStateType::create_unique(this, state);
505
30
    RETURN_IF_ERROR(local_state->init(state, info));
506
30
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
30
    return Status::OK();
508
30
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
236k
                                                            LocalSinkStateInfo& info) {
504
236k
    auto local_state = LocalStateType::create_unique(this, state);
505
236k
    RETURN_IF_ERROR(local_state->init(state, info));
506
236k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
236k
    return Status::OK();
508
236k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
84.5k
                                                            LocalSinkStateInfo& info) {
504
84.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
84.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
84.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
84.5k
    return Status::OK();
508
84.5k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
83.8k
                                                            LocalSinkStateInfo& info) {
504
83.8k
    auto local_state = LocalStateType::create_unique(this, state);
505
83.8k
    RETURN_IF_ERROR(local_state->init(state, info));
506
83.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
83.8k
    return Status::OK();
508
83.8k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
32
                                                            LocalSinkStateInfo& info) {
504
32
    auto local_state = LocalStateType::create_unique(this, state);
505
32
    RETURN_IF_ERROR(local_state->init(state, info));
506
32
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
32
    return Status::OK();
508
32
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
447k
                                                            LocalSinkStateInfo& info) {
504
447k
    auto local_state = LocalStateType::create_unique(this, state);
505
447k
    RETURN_IF_ERROR(local_state->init(state, info));
506
447k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
447k
    return Status::OK();
508
447k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.94k
                                                            LocalSinkStateInfo& info) {
504
5.94k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.94k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.94k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.94k
    return Status::OK();
508
5.94k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.36k
                                                            LocalSinkStateInfo& info) {
504
5.36k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.36k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.36k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.36k
    return Status::OK();
508
5.36k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.33k
                                                            LocalSinkStateInfo& info) {
504
2.33k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.33k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.33k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.33k
    return Status::OK();
508
2.33k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
320
                                                            LocalSinkStateInfo& info) {
504
320
    auto local_state = LocalStateType::create_unique(this, state);
505
320
    RETURN_IF_ERROR(local_state->init(state, info));
506
320
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
320
    return Status::OK();
508
320
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.88k
                                                            LocalSinkStateInfo& info) {
504
4.88k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.88k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.88k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.88k
    return Status::OK();
508
4.88k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.64k
                                                            LocalSinkStateInfo& info) {
504
2.64k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.64k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.64k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.64k
    return Status::OK();
508
2.64k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.60k
                                                            LocalSinkStateInfo& info) {
504
2.60k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.60k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.60k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.60k
    return Status::OK();
508
2.60k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.46k
                                                            LocalSinkStateInfo& info) {
504
2.46k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.46k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.46k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.46k
    return Status::OK();
508
2.46k
}
_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
100
                                                            LocalSinkStateInfo& info) {
504
100
    auto local_state = LocalStateType::create_unique(this, state);
505
100
    RETURN_IF_ERROR(local_state->init(state, info));
506
100
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
100
    return Status::OK();
508
100
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
509
510
template <typename LocalStateType>
511
1.23M
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.23M
    } else {
519
1.23M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.23M
        ss->id = operator_id();
521
1.23M
        for (auto& dest : dests_id()) {
522
1.22M
            ss->related_op_ids.insert(dest);
523
1.22M
        }
524
1.23M
        return ss;
525
1.23M
    }
526
1.23M
}
_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
101k
            ss->related_op_ids.insert(dest);
523
101k
        }
524
101k
        return ss;
525
101k
    }
526
101k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
384k
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
384k
    } else {
519
384k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
384k
        ss->id = operator_id();
521
384k
        for (auto& dest : dests_id()) {
522
382k
            ss->related_op_ids.insert(dest);
523
382k
        }
524
384k
        return ss;
525
384k
    }
526
384k
}
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
353
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
353
    } else {
519
353
        auto ss = LocalStateType::SharedStateType::create_shared();
520
353
        ss->id = operator_id();
521
353
        for (auto& dest : dests_id()) {
522
353
            ss->related_op_ids.insert(dest);
523
353
        }
524
353
        return ss;
525
353
    }
526
353
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
43.6k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
43.6k
    } else {
519
43.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
43.6k
        ss->id = operator_id();
521
43.6k
        for (auto& dest : dests_id()) {
522
43.2k
            ss->related_op_ids.insert(dest);
523
43.2k
        }
524
43.6k
        return ss;
525
43.6k
    }
526
43.6k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
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
7.75k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
7.75k
    } else {
519
7.75k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7.75k
        ss->id = operator_id();
521
7.75k
        for (auto& dest : dests_id()) {
522
7.74k
            ss->related_op_ids.insert(dest);
523
7.74k
        }
524
7.75k
        return ss;
525
7.75k
    }
526
7.75k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
21
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
21
    } else {
519
21
        auto ss = LocalStateType::SharedStateType::create_shared();
520
21
        ss->id = operator_id();
521
21
        for (auto& dest : dests_id()) {
522
21
            ss->related_op_ids.insert(dest);
523
21
        }
524
21
        return ss;
525
21
    }
526
21
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
155k
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
155k
    } else {
519
155k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
155k
        ss->id = operator_id();
521
155k
        for (auto& dest : dests_id()) {
522
155k
            ss->related_op_ids.insert(dest);
523
155k
        }
524
155k
        return ss;
525
155k
    }
526
155k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
32
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
32
    } else {
519
32
        auto ss = LocalStateType::SharedStateType::create_shared();
520
32
        ss->id = operator_id();
521
32
        for (auto& dest : dests_id()) {
522
32
            ss->related_op_ids.insert(dest);
523
32
        }
524
32
        return ss;
525
32
    }
526
32
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
84.7k
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
84.7k
    } else {
519
84.7k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
84.7k
        ss->id = operator_id();
521
84.7k
        for (auto& dest : dests_id()) {
522
84.7k
            ss->related_op_ids.insert(dest);
523
84.7k
        }
524
84.7k
        return ss;
525
84.7k
    }
526
84.7k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
31
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
31
    } else {
519
31
        auto ss = LocalStateType::SharedStateType::create_shared();
520
31
        ss->id = operator_id();
521
31
        for (auto& dest : dests_id()) {
522
31
            ss->related_op_ids.insert(dest);
523
31
        }
524
31
        return ss;
525
31
    }
526
31
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
448k
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
448k
    } else {
519
448k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
448k
        ss->id = operator_id();
521
448k
        for (auto& dest : dests_id()) {
522
440k
            ss->related_op_ids.insert(dest);
523
440k
        }
524
448k
        return ss;
525
448k
    }
526
448k
}
_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.95k
            ss->related_op_ids.insert(dest);
523
5.95k
        }
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
423
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
423
    } else {
519
423
        auto ss = LocalStateType::SharedStateType::create_shared();
520
423
        ss->id = operator_id();
521
423
        for (auto& dest : dests_id()) {
522
423
            ss->related_op_ids.insert(dest);
523
423
        }
524
423
        return ss;
525
423
    }
526
423
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.60k
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.60k
    } else {
519
2.60k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.60k
        ss->id = operator_id();
521
2.61k
        for (auto& dest : dests_id()) {
522
2.61k
            ss->related_op_ids.insert(dest);
523
2.61k
        }
524
2.60k
        return ss;
525
2.60k
    }
526
2.60k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.47k
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.47k
    } else {
519
2.47k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.47k
        ss->id = operator_id();
521
2.49k
        for (auto& dest : dests_id()) {
522
2.49k
            ss->related_op_ids.insert(dest);
523
2.49k
        }
524
2.47k
        return ss;
525
2.47k
    }
526
2.47k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
567
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
567
    } else {
519
567
        auto ss = LocalStateType::SharedStateType::create_shared();
520
567
        ss->id = operator_id();
521
567
        for (auto& dest : dests_id()) {
522
554
            ss->related_op_ids.insert(dest);
523
554
        }
524
567
        return ss;
525
567
    }
526
567
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
100
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
100
    } else {
519
100
        auto ss = LocalStateType::SharedStateType::create_shared();
520
100
        ss->id = operator_id();
521
100
        for (auto& dest : dests_id()) {
522
100
            ss->related_op_ids.insert(dest);
523
100
        }
524
100
        return ss;
525
100
    }
526
100
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.93M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.93M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.93M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.93M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.93M
    return Status::OK();
534
1.93M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
68.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
68.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
68.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
68.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
68.8k
    return Status::OK();
534
68.8k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
233k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
233k
    auto local_state = LocalStateType::create_unique(state, this);
531
233k
    RETURN_IF_ERROR(local_state->init(state, info));
532
233k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
233k
    return Status::OK();
534
233k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
129
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
129
    auto local_state = LocalStateType::create_unique(state, this);
531
129
    RETURN_IF_ERROR(local_state->init(state, info));
532
129
    state->emplace_local_state(operator_id(), std::move(local_state));
533
129
    return Status::OK();
534
129
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.07k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.07k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.07k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.07k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.07k
    return Status::OK();
534
3.07k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.69k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.69k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.69k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.69k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.69k
    return Status::OK();
534
7.69k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.55k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.55k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.55k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.55k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.55k
    return Status::OK();
534
7.55k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
23
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
23
    auto local_state = LocalStateType::create_unique(state, this);
531
23
    RETURN_IF_ERROR(local_state->init(state, info));
532
23
    state->emplace_local_state(operator_id(), std::move(local_state));
533
23
    return Status::OK();
534
23
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
146k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
146k
    auto local_state = LocalStateType::create_unique(state, this);
531
146k
    RETURN_IF_ERROR(local_state->init(state, info));
532
146k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
146k
    return Status::OK();
534
146k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
84.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
84.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
84.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
84.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
84.3k
    return Status::OK();
534
84.3k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
84.9k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
84.9k
    auto local_state = LocalStateType::create_unique(state, this);
531
84.9k
    RETURN_IF_ERROR(local_state->init(state, info));
532
84.9k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
84.9k
    return Status::OK();
534
84.9k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
22
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
22
    auto local_state = LocalStateType::create_unique(state, this);
531
22
    RETURN_IF_ERROR(local_state->init(state, info));
532
22
    state->emplace_local_state(operator_id(), std::move(local_state));
533
22
    return Status::OK();
534
22
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.06k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.06k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.06k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.06k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.06k
    return Status::OK();
534
4.06k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
283k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
283k
    auto local_state = LocalStateType::create_unique(state, this);
531
283k
    RETURN_IF_ERROR(local_state->init(state, info));
532
283k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
283k
    return Status::OK();
534
283k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.26k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.26k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.26k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.26k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.26k
    return Status::OK();
534
1.26k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.87k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.87k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.87k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.87k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.87k
    return Status::OK();
534
5.87k
}
_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.51k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.51k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.51k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.51k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.51k
    return Status::OK();
534
1.51k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
51.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
51.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
51.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
51.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
51.0k
    return Status::OK();
534
51.0k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.01k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.01k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.01k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.01k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.01k
    return Status::OK();
534
6.01k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
317
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
317
    auto local_state = LocalStateType::create_unique(state, this);
531
317
    RETURN_IF_ERROR(local_state->init(state, info));
532
317
    state->emplace_local_state(operator_id(), std::move(local_state));
533
317
    return Status::OK();
534
317
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.56k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.56k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.56k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.56k
    return Status::OK();
534
2.56k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.44k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.44k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.44k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.44k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.44k
    return Status::OK();
534
2.44k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
311
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
311
    auto local_state = LocalStateType::create_unique(state, this);
531
311
    RETURN_IF_ERROR(local_state->init(state, info));
532
311
    state->emplace_local_state(operator_id(), std::move(local_state));
533
311
    return Status::OK();
534
311
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.57k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.57k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.57k
    return Status::OK();
534
1.57k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.22k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.22k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.22k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.22k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.22k
    return Status::OK();
534
4.22k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
596k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
596k
    auto local_state = LocalStateType::create_unique(state, this);
531
596k
    RETURN_IF_ERROR(local_state->init(state, info));
532
596k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
596k
    return Status::OK();
534
596k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
12
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
12
    auto local_state = LocalStateType::create_unique(state, this);
531
12
    RETURN_IF_ERROR(local_state->init(state, info));
532
12
    state->emplace_local_state(operator_id(), std::move(local_state));
533
12
    return Status::OK();
534
12
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
164
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
164
    auto local_state = LocalStateType::create_unique(state, this);
531
164
    RETURN_IF_ERROR(local_state->init(state, info));
532
164
    state->emplace_local_state(operator_id(), std::move(local_state));
533
164
    return Status::OK();
534
164
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.18k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.18k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.18k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.18k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.18k
    return Status::OK();
534
2.18k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
787
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
787
    auto local_state = LocalStateType::create_unique(state, this);
531
787
    RETURN_IF_ERROR(local_state->init(state, info));
532
787
    state->emplace_local_state(operator_id(), std::move(local_state));
533
787
    return Status::OK();
534
787
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
847
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
847
    auto local_state = LocalStateType::create_unique(state, this);
531
847
    RETURN_IF_ERROR(local_state->init(state, info));
532
847
    state->emplace_local_state(operator_id(), std::move(local_state));
533
847
    return Status::OK();
534
847
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.57k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.57k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.57k
    return Status::OK();
534
5.57k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
326k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
326k
    auto local_state = LocalStateType::create_unique(state, this);
531
326k
    RETURN_IF_ERROR(local_state->init(state, info));
532
326k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
326k
    return Status::OK();
534
326k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.58M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.92M
        : _num_rows_returned(0),
542
1.92M
          _rows_returned_counter(nullptr),
543
1.92M
          _parent(parent),
544
1.92M
          _state(state),
545
1.92M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.93M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.93M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.93M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.93M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.93M
    _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.93M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.93M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.93M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.93M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.93M
    if constexpr (!is_fake_shared) {
560
1.06M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
694k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
694k
                                    .first.get()
563
694k
                                    ->template cast<SharedStateArg>();
564
565
694k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
694k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
694k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
694k
        } else if (info.shared_state) {
569
314k
            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
314k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
314k
            _dependency = _shared_state->create_source_dependency(
576
314k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
314k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
314k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
314k
        } else {
580
59.9k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
5.26k
                DCHECK(false);
582
5.26k
            }
583
59.9k
        }
584
1.06M
    }
585
586
1.93M
    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.93M
    _rows_returned_counter =
591
1.93M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.93M
    _blocks_returned_counter =
593
1.93M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.93M
    _output_block_bytes_counter =
595
1.93M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.93M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.93M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.93M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.93M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.93M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.93M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.93M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.93M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.93M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.93M
    _memory_used_counter =
606
1.93M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.93M
    _common_profile->add_info_string("IsColocate",
608
1.93M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.93M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.93M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.93M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.93M
    return Status::OK();
613
1.93M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
68.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
68.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
68.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
68.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
68.8k
    _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
68.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
68.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
68.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
68.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
68.8k
    if constexpr (!is_fake_shared) {
560
68.8k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
15.6k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
15.6k
                                    .first.get()
563
15.6k
                                    ->template cast<SharedStateArg>();
564
565
15.6k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
15.6k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
15.6k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
53.2k
        } 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.5k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
52.5k
            _dependency = _shared_state->create_source_dependency(
576
52.5k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
52.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
52.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
52.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
703
        }
584
68.8k
    }
585
586
68.8k
    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
68.8k
    _rows_returned_counter =
591
68.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
68.8k
    _blocks_returned_counter =
593
68.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
68.8k
    _output_block_bytes_counter =
595
68.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
68.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
68.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
68.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
68.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
68.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
68.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
68.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
68.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
68.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
68.8k
    _memory_used_counter =
606
68.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
68.8k
    _common_profile->add_info_string("IsColocate",
608
68.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
68.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
68.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
68.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
68.8k
    return Status::OK();
613
68.8k
}
_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
154k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
154k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
154k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
154k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
154k
    _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
154k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
154k
    _operator_profile->add_child(_common_profile.get(), true);
557
154k
    _operator_profile->add_child(_custom_profile.get(), true);
558
154k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
154k
    if constexpr (!is_fake_shared) {
560
154k
        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
154k
        } 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
151k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
151k
            _dependency = _shared_state->create_source_dependency(
576
151k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
151k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
151k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
151k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
3.43k
        }
584
154k
    }
585
586
154k
    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
154k
    _rows_returned_counter =
591
154k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
154k
    _blocks_returned_counter =
593
154k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
154k
    _output_block_bytes_counter =
595
154k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
154k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
154k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
154k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
154k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
154k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
154k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
154k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
154k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
154k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
154k
    _memory_used_counter =
606
154k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
154k
    _common_profile->add_info_string("IsColocate",
608
154k
                                     std::to_string(_parent->is_colocated_operator()));
609
154k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
154k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
154k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
154k
    return Status::OK();
613
154k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
23
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
23
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
23
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
23
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
23
    _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
23
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
23
    _operator_profile->add_child(_common_profile.get(), true);
557
23
    _operator_profile->add_child(_custom_profile.get(), true);
558
23
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
23
    if constexpr (!is_fake_shared) {
560
23
        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
23
        } 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
23
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
23
            _dependency = _shared_state->create_source_dependency(
576
23
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
23
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
23
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
23
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
23
    }
585
586
23
    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
23
    _rows_returned_counter =
591
23
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
23
    _blocks_returned_counter =
593
23
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
23
    _output_block_bytes_counter =
595
23
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
23
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
23
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
23
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
23
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
23
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
23
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
23
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
23
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
23
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
23
    _memory_used_counter =
606
23
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
23
    _common_profile->add_info_string("IsColocate",
608
23
                                     std::to_string(_parent->is_colocated_operator()));
609
23
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
23
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
23
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
23
    return Status::OK();
613
23
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.87k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.87k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.87k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.87k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.87k
    _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.87k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.87k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.87k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.87k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.87k
    if constexpr (!is_fake_shared) {
560
5.87k
        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.87k
        } 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.80k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.80k
            _dependency = _shared_state->create_source_dependency(
576
5.80k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.80k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.80k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.80k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
72
        }
584
5.87k
    }
585
586
5.87k
    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.87k
    _rows_returned_counter =
591
5.87k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.87k
    _blocks_returned_counter =
593
5.87k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.87k
    _output_block_bytes_counter =
595
5.87k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.87k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.87k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.87k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.87k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.87k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.87k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.87k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.87k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.87k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.87k
    _memory_used_counter =
606
5.87k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.87k
    _common_profile->add_info_string("IsColocate",
608
5.87k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.87k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.87k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.87k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.87k
    return Status::OK();
613
5.87k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
7.73k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
7.73k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
7.73k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
7.73k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
7.73k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
7.73k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
7.73k
    _operator_profile->add_child(_common_profile.get(), true);
557
7.73k
    _operator_profile->add_child(_custom_profile.get(), true);
558
7.73k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
7.73k
    if constexpr (!is_fake_shared) {
560
7.73k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
7.73k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
7.65k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
7.65k
            _dependency = _shared_state->create_source_dependency(
576
7.65k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
7.65k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
7.65k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
7.65k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
75
        }
584
7.73k
    }
585
586
7.73k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
7.73k
    _rows_returned_counter =
591
7.73k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
7.73k
    _blocks_returned_counter =
593
7.73k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
7.73k
    _output_block_bytes_counter =
595
7.73k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.73k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
7.73k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
7.73k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
7.73k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
7.73k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
7.73k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
7.73k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
7.73k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
7.73k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
7.73k
    _memory_used_counter =
606
7.73k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
7.73k
    _common_profile->add_info_string("IsColocate",
608
7.73k
                                     std::to_string(_parent->is_colocated_operator()));
609
7.73k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
7.73k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
7.73k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
7.73k
    return Status::OK();
613
7.73k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
84.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
84.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
84.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
84.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
84.5k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
84.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
84.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
84.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
84.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
84.5k
    if constexpr (!is_fake_shared) {
560
84.5k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
84.5k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
82.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
82.9k
            _dependency = _shared_state->create_source_dependency(
576
82.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
82.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
82.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
82.9k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.61k
        }
584
84.5k
    }
585
586
84.5k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
84.5k
    _rows_returned_counter =
591
84.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
84.5k
    _blocks_returned_counter =
593
84.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
84.5k
    _output_block_bytes_counter =
595
84.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
84.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
84.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
84.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
84.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
84.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
84.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
84.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
84.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
84.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
84.5k
    _memory_used_counter =
606
84.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
84.5k
    _common_profile->add_info_string("IsColocate",
608
84.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
84.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
84.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
84.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
84.5k
    return Status::OK();
613
84.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
84.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
84.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
84.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
84.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
84.8k
    _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
84.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
84.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
84.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
84.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
84.8k
    if constexpr (!is_fake_shared) {
560
84.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
84.9k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
84.9k
                                    .first.get()
563
84.9k
                                    ->template cast<SharedStateArg>();
564
565
84.9k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
84.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
84.9k
                    _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
84.8k
    }
585
586
84.8k
    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
84.8k
    _rows_returned_counter =
591
84.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
84.8k
    _blocks_returned_counter =
593
84.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
84.8k
    _output_block_bytes_counter =
595
84.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
84.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
84.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
84.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
84.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
84.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
84.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
84.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
84.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
84.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
84.8k
    _memory_used_counter =
606
84.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
84.8k
    _common_profile->add_info_string("IsColocate",
608
84.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
84.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
84.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
84.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
84.8k
    return Status::OK();
613
84.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
22
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
22
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
22
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
22
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
22
    _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
22
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
22
    _operator_profile->add_child(_common_profile.get(), true);
557
22
    _operator_profile->add_child(_custom_profile.get(), true);
558
22
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
22
    if constexpr (!is_fake_shared) {
560
22
        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
22
        } 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
22
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
22
            _dependency = _shared_state->create_source_dependency(
576
22
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
22
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
22
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
22
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
22
    }
585
586
22
    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
22
    _rows_returned_counter =
591
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
22
    _blocks_returned_counter =
593
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
22
    _output_block_bytes_counter =
595
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
22
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
22
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
22
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
22
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
22
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
22
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
22
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
22
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
22
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
22
    _memory_used_counter =
606
22
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
22
    _common_profile->add_info_string("IsColocate",
608
22
                                     std::to_string(_parent->is_colocated_operator()));
609
22
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
22
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
22
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
22
    return Status::OK();
613
22
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
865k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
865k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
865k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
865k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
865k
    _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
865k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
865k
    _operator_profile->add_child(_common_profile.get(), true);
557
865k
    _operator_profile->add_child(_custom_profile.get(), true);
558
865k
    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
865k
    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
865k
    _rows_returned_counter =
591
865k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
865k
    _blocks_returned_counter =
593
865k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
865k
    _output_block_bytes_counter =
595
865k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
865k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
865k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
865k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
865k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
865k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
865k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
865k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
865k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
865k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
865k
    _memory_used_counter =
606
865k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
865k
    _common_profile->add_info_string("IsColocate",
608
865k
                                     std::to_string(_parent->is_colocated_operator()));
609
865k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
865k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
865k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
865k
    return Status::OK();
613
865k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
50.9k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
50.9k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
50.9k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
50.9k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
50.9k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
50.9k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
50.9k
    _operator_profile->add_child(_common_profile.get(), true);
557
50.9k
    _operator_profile->add_child(_custom_profile.get(), true);
558
50.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
50.9k
    if constexpr (!is_fake_shared) {
560
50.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
50.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
2.52k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
2.52k
            _dependency = _shared_state->create_source_dependency(
576
2.52k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
2.52k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
2.52k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
48.4k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
48.4k
        }
584
50.9k
    }
585
586
50.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
50.9k
    _rows_returned_counter =
591
50.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
50.9k
    _blocks_returned_counter =
593
50.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
50.9k
    _output_block_bytes_counter =
595
50.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
50.9k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
50.9k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
50.9k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
50.9k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
50.9k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
50.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
50.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
50.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
50.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
50.9k
    _memory_used_counter =
606
50.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
50.9k
    _common_profile->add_info_string("IsColocate",
608
50.9k
                                     std::to_string(_parent->is_colocated_operator()));
609
50.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
50.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
50.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
50.9k
    return Status::OK();
613
50.9k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
25
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
25
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
25
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
25
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
25
    _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
25
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
25
    _operator_profile->add_child(_common_profile.get(), true);
557
25
    _operator_profile->add_child(_custom_profile.get(), true);
558
25
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
25
    if constexpr (!is_fake_shared) {
560
25
        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
25
        } 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
25
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
25
            _dependency = _shared_state->create_source_dependency(
576
25
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
25
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
25
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
25
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
25
    }
585
586
25
    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
25
    _rows_returned_counter =
591
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
25
    _blocks_returned_counter =
593
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
25
    _output_block_bytes_counter =
595
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
25
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
25
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
25
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
25
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
25
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
25
    _memory_used_counter =
606
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
25
    _common_profile->add_info_string("IsColocate",
608
25
                                     std::to_string(_parent->is_colocated_operator()));
609
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
25
    return Status::OK();
613
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.01k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.01k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.01k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.01k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.01k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.01k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.01k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.01k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.01k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.01k
    if constexpr (!is_fake_shared) {
560
6.01k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.01k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.00k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.00k
            _dependency = _shared_state->create_source_dependency(
576
6.00k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.00k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.00k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.00k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
9
        }
584
6.01k
    }
585
586
6.01k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.01k
    _rows_returned_counter =
591
6.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.01k
    _blocks_returned_counter =
593
6.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.01k
    _output_block_bytes_counter =
595
6.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.01k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.01k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.01k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.01k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.01k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.01k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.01k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.01k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.01k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.01k
    _memory_used_counter =
606
6.01k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.01k
    _common_profile->add_info_string("IsColocate",
608
6.01k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.01k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.01k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.01k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.01k
    return Status::OK();
613
6.01k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
424
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
424
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
424
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
424
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
424
    _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
424
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
424
    _operator_profile->add_child(_common_profile.get(), true);
557
424
    _operator_profile->add_child(_custom_profile.get(), true);
558
424
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
424
    if constexpr (!is_fake_shared) {
560
424
        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
424
        } 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
422
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
422
            _dependency = _shared_state->create_source_dependency(
576
422
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
422
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
422
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
422
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
2
        }
584
424
    }
585
586
424
    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
424
    _rows_returned_counter =
591
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
424
    _blocks_returned_counter =
593
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
424
    _output_block_bytes_counter =
595
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
424
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
424
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
424
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
424
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
424
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
424
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
424
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
424
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
424
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
424
    _memory_used_counter =
606
424
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
424
    _common_profile->add_info_string("IsColocate",
608
424
                                     std::to_string(_parent->is_colocated_operator()));
609
424
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
424
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
424
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
424
    return Status::OK();
613
424
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.11k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.11k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.11k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.11k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.11k
    _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.11k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.11k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.11k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.11k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.11k
    if constexpr (!is_fake_shared) {
560
5.11k
        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.11k
        } 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.73k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.73k
            _dependency = _shared_state->create_source_dependency(
576
4.73k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.73k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.73k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.73k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
379
        }
584
5.11k
    }
585
586
5.11k
    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.11k
    _rows_returned_counter =
591
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.11k
    _blocks_returned_counter =
593
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.11k
    _output_block_bytes_counter =
595
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.11k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.11k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.11k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.11k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.11k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.11k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.11k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.11k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.11k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.11k
    _memory_used_counter =
606
5.11k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.11k
    _common_profile->add_info_string("IsColocate",
608
5.11k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.11k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.11k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.11k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.11k
    return Status::OK();
613
5.11k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
599k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
599k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
599k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
599k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
599k
    _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
599k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
599k
    _operator_profile->add_child(_common_profile.get(), true);
557
599k
    _operator_profile->add_child(_custom_profile.get(), true);
558
599k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
599k
    if constexpr (!is_fake_shared) {
560
599k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
593k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
593k
                                    .first.get()
563
593k
                                    ->template cast<SharedStateArg>();
564
565
593k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
593k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
593k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
593k
        } else if (info.shared_state) {
569
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.26k
        } else {
580
5.26k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
5.26k
                DCHECK(false);
582
5.26k
            }
583
5.26k
        }
584
599k
    }
585
586
599k
    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
599k
    _rows_returned_counter =
591
599k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
599k
    _blocks_returned_counter =
593
599k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
599k
    _output_block_bytes_counter =
595
599k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
599k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
599k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
599k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
599k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
599k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
599k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
599k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
599k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
599k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
599k
    _memory_used_counter =
606
599k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
599k
    _common_profile->add_info_string("IsColocate",
608
599k
                                     std::to_string(_parent->is_colocated_operator()));
609
599k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
599k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
599k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
599k
    return Status::OK();
613
599k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
164
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
164
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
164
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
164
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
164
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
164
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
164
    _operator_profile->add_child(_common_profile.get(), true);
557
164
    _operator_profile->add_child(_custom_profile.get(), true);
558
164
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
164
    if constexpr (!is_fake_shared) {
560
164
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
164
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
164
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
164
            _dependency = _shared_state->create_source_dependency(
576
164
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
164
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
164
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
164
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
164
    }
585
586
164
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
164
    _rows_returned_counter =
591
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
164
    _blocks_returned_counter =
593
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
164
    _output_block_bytes_counter =
595
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
164
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
164
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
164
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
164
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
164
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
164
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
164
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
164
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
164
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
164
    _memory_used_counter =
606
164
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
164
    _common_profile->add_info_string("IsColocate",
608
164
                                     std::to_string(_parent->is_colocated_operator()));
609
164
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
164
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
164
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
164
    return Status::OK();
613
164
}
614
615
template <typename SharedStateArg>
616
1.94M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.94M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.23M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
282k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
282k
    }
621
1.94M
    if (_parent->has_projection()) {
622
350k
        const auto& projection = *_parent->_projection;
623
350k
        _projections.resize(projection.projections.size());
624
2.15M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.80M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.80M
        }
627
350k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
356k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.10k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
38.2k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
32.1k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
32.1k
                        state, _intermediate_projections[i][j]));
633
32.1k
            }
634
6.10k
        }
635
350k
    }
636
1.94M
    return Status::OK();
637
1.94M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
69.5k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
69.5k
    _conjuncts.resize(_parent->_conjuncts.size());
618
70.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
738
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
738
    }
621
69.5k
    if (_parent->has_projection()) {
622
69.5k
        const auto& projection = *_parent->_projection;
623
69.5k
        _projections.resize(projection.projections.size());
624
347k
        for (size_t i = 0; i < _projections.size(); i++) {
625
278k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
278k
        }
627
69.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
70.3k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
729
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
5.51k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
4.78k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
4.78k
                        state, _intermediate_projections[i][j]));
633
4.78k
            }
634
729
        }
635
69.5k
    }
636
69.5k
    return Status::OK();
637
69.5k
}
_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
156k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
156k
    _conjuncts.resize(_parent->_conjuncts.size());
618
156k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
156k
    if (_parent->has_projection()) {
622
75
        const auto& projection = *_parent->_projection;
623
75
        _projections.resize(projection.projections.size());
624
371
        for (size_t i = 0; i < _projections.size(); i++) {
625
296
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
296
        }
627
75
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
75
        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
75
    }
636
156k
    return Status::OK();
637
156k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
22
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
22
    _conjuncts.resize(_parent->_conjuncts.size());
618
22
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
22
    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
22
    return Status::OK();
637
22
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.99k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.99k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.04k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
41
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
41
    }
621
6.00k
    if (_parent->has_projection()) {
622
6.00k
        const auto& projection = *_parent->_projection;
623
6.00k
        _projections.resize(projection.projections.size());
624
25.6k
        for (size_t i = 0; i < _projections.size(); i++) {
625
19.6k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
19.6k
        }
627
6.00k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.01k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
13
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
123
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
110
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
110
                        state, _intermediate_projections[i][j]));
633
110
            }
634
13
        }
635
6.00k
    }
636
5.99k
    return Status::OK();
637
5.99k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
7.76k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
7.76k
    _conjuncts.resize(_parent->_conjuncts.size());
618
8.40k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
647
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
647
    }
621
7.76k
    if (_parent->has_projection()) {
622
4.44k
        const auto& projection = *_parent->_projection;
623
4.44k
        _projections.resize(projection.projections.size());
624
17.7k
        for (size_t i = 0; i < _projections.size(); i++) {
625
13.3k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
13.3k
        }
627
4.44k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.52k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
83
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
618
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
535
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
535
                        state, _intermediate_projections[i][j]));
633
535
            }
634
83
        }
635
4.44k
    }
636
7.76k
    return Status::OK();
637
7.76k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
85.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
85.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
86.5k
    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
85.0k
    if (_parent->has_projection()) {
622
26.8k
        const auto& projection = *_parent->_projection;
623
26.8k
        _projections.resize(projection.projections.size());
624
236k
        for (size_t i = 0; i < _projections.size(); i++) {
625
210k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
210k
        }
627
26.8k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
26.9k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
180
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.20k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
1.02k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
1.02k
                        state, _intermediate_projections[i][j]));
633
1.02k
            }
634
180
        }
635
26.8k
    }
636
85.0k
    return Status::OK();
637
85.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
84.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
84.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
84.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
6
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
6
    }
621
84.8k
    if (_parent->has_projection()) {
622
105
        const auto& projection = *_parent->_projection;
623
105
        _projections.resize(projection.projections.size());
624
373
        for (size_t i = 0; i < _projections.size(); i++) {
625
268
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
268
        }
627
105
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
105
        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
105
    }
636
84.8k
    return Status::OK();
637
84.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_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_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
871k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
871k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.15M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
279k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
279k
    }
621
871k
    if (_parent->has_projection()) {
622
233k
        const auto& projection = *_parent->_projection;
623
233k
        _projections.resize(projection.projections.size());
624
1.43M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.19M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.19M
        }
627
233k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
238k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
5.10k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
30.7k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
25.6k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
25.6k
                        state, _intermediate_projections[i][j]));
633
25.6k
            }
634
5.10k
        }
635
233k
    }
636
871k
    return Status::OK();
637
871k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
51.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
51.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
51.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
51.3k
    if (_parent->has_projection()) {
622
9.66k
        const auto& projection = *_parent->_projection;
623
9.66k
        _projections.resize(projection.projections.size());
624
94.4k
        for (size_t i = 0; i < _projections.size(); i++) {
625
84.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
84.7k
        }
627
9.66k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
9.66k
        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
9.66k
    }
636
51.3k
    return Status::OK();
637
51.3k
}
_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
6.01k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.01k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.59k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
576
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
576
    }
621
6.01k
    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
6.01k
    return Status::OK();
637
6.01k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
424
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
424
    _conjuncts.resize(_parent->_conjuncts.size());
618
424
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
424
    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
424
    return Status::OK();
637
424
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.20k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.20k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.20k
    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.20k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
228
        for (size_t i = 0; i < _projections.size(); i++) {
625
168
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
168
        }
627
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
60
    }
636
5.20k
    return Status::OK();
637
5.20k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
603k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
603k
    _conjuncts.resize(_parent->_conjuncts.size());
618
603k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
603k
    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
603k
    return Status::OK();
637
603k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
164
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
164
    _conjuncts.resize(_parent->_conjuncts.size());
618
171
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
164
    if (_parent->has_projection()) {
622
160
        const auto& projection = *_parent->_projection;
623
160
        _projections.resize(projection.projections.size());
624
479
        for (size_t i = 0; i < _projections.size(); i++) {
625
319
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
319
        }
627
160
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
163
        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
160
    }
636
164
    return Status::OK();
637
164
}
638
639
template <typename SharedStateArg>
640
6.26k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.26k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.26k
    _terminated = true;
645
6.26k
    return Status::OK();
646
6.26k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
318
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
318
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
318
    _terminated = true;
645
318
    return Status::OK();
646
318
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
22
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
22
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
22
    _terminated = true;
645
22
    return Status::OK();
646
22
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
45
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
45
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
45
    _terminated = true;
645
45
    return Status::OK();
646
45
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1
    _terminated = true;
645
1
    return Status::OK();
646
1
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
153
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
153
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
153
    _terminated = true;
645
153
    return Status::OK();
646
153
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4.60k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4.60k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
4.60k
    _terminated = true;
645
4.60k
    return Status::OK();
646
4.60k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
7
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7
    _terminated = true;
645
7
    return Status::OK();
646
7
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
2
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
2
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
2
    _terminated = true;
645
2
    return Status::OK();
646
2
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
244
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
244
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
244
    _terminated = true;
645
244
    return Status::OK();
646
244
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
838
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
838
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
838
    _terminated = true;
645
838
    return Status::OK();
646
838
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
36
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
36
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
36
    _terminated = true;
645
36
    return Status::OK();
646
36
}
647
648
template <typename SharedStateArg>
649
2.13M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.13M
    if (_closed) {
651
183k
        return Status::OK();
652
183k
    }
653
1.94M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.07M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.07M
    }
656
1.94M
    _closed = true;
657
1.94M
    return Status::OK();
658
2.13M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
69.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
69.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
69.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
69.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
69.5k
    }
656
69.5k
    _closed = true;
657
69.5k
    return Status::OK();
658
69.5k
}
_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
310k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
310k
    if (_closed) {
651
155k
        return Status::OK();
652
155k
    }
653
155k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
155k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
155k
    }
656
155k
    _closed = true;
657
155k
    return Status::OK();
658
310k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
23
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
23
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
23
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
23
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
23
    }
656
23
    _closed = true;
657
23
    return Status::OK();
658
23
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.00k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.00k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.00k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.00k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.00k
    }
656
6.00k
    _closed = true;
657
6.00k
    return Status::OK();
658
6.00k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
15.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
15.6k
    if (_closed) {
651
7.87k
        return Status::OK();
652
7.87k
    }
653
7.73k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
7.73k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
7.73k
    }
656
7.73k
    _closed = true;
657
7.73k
    return Status::OK();
658
15.6k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
84.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
84.9k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
84.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
84.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
84.9k
    }
656
84.9k
    _closed = true;
657
84.9k
    return Status::OK();
658
84.9k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
84.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
84.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
84.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
84.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
84.5k
    }
656
84.5k
    _closed = true;
657
84.5k
    return Status::OK();
658
84.5k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
21
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
21
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
21
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
21
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
21
    }
656
21
    _closed = true;
657
21
    return Status::OK();
658
21
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
886k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
886k
    if (_closed) {
651
14.4k
        return Status::OK();
652
14.4k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
872k
    _closed = true;
657
872k
    return Status::OK();
658
886k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
51.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
51.3k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
51.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
51.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
51.3k
    }
656
51.3k
    _closed = true;
657
51.3k
    return Status::OK();
658
51.3k
}
_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
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_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
642
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
642
    if (_closed) {
651
321
        return Status::OK();
652
321
    }
653
321
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
321
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
321
    }
656
321
    _closed = true;
657
321
    return Status::OK();
658
642
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.5k
    if (_closed) {
651
5.33k
        return Status::OK();
652
5.33k
    }
653
5.19k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.19k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.19k
    }
656
5.19k
    _closed = true;
657
5.19k
    return Status::OK();
658
10.5k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
604k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
604k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
604k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
604k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
604k
    }
656
604k
    _closed = true;
657
604k
    return Status::OK();
658
604k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
326
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
326
    if (_closed) {
651
171
        return Status::OK();
652
171
    }
653
155
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
155
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
155
    }
656
155
    _closed = true;
657
155
    return Status::OK();
658
326
}
659
660
template <typename SharedState>
661
1.59M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.59M
    _operator_profile =
664
1.59M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.59M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.59M
    _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.59M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.59M
    _operator_profile->add_child(_common_profile, true);
673
1.59M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.59M
    _operator_profile->set_metadata(_parent->node_id());
676
1.59M
    _wait_for_finish_dependency_timer =
677
1.59M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.59M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.59M
    if constexpr (!is_fake_shared) {
680
1.14M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.14M
            info.shared_state_map.end()) {
682
338k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
237k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
237k
            }
685
338k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
338k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
338k
                                                  ? 0
688
338k
                                                  : info.task_idx]
689
338k
                                  .get();
690
338k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
805k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
805k
            _shared_state = info.shared_state->template cast<SharedState>();
696
805k
            _dependency = _shared_state->create_sink_dependency(
697
805k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
805k
        }
699
1.14M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.14M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.14M
    }
702
703
1.59M
    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.59M
    _rows_input_counter =
708
1.59M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.59M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.59M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.59M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.59M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.59M
    _memory_used_counter =
714
1.59M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.59M
    _common_profile->add_info_string("IsColocate",
716
1.59M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.59M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.59M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.59M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.59M
    return Status::OK();
721
1.59M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
117k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
117k
    _operator_profile =
664
117k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
117k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
117k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
117k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
117k
    _operator_profile->add_child(_common_profile, true);
673
117k
    _operator_profile->add_child(_custom_profile, true);
674
675
117k
    _operator_profile->set_metadata(_parent->node_id());
676
117k
    _wait_for_finish_dependency_timer =
677
117k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
117k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
117k
    if constexpr (!is_fake_shared) {
680
117k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
117k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
16.0k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
16.0k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
16.0k
                                                  ? 0
688
16.0k
                                                  : info.task_idx]
689
16.0k
                                  .get();
690
16.0k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
101k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
101k
            _shared_state = info.shared_state->template cast<SharedState>();
696
101k
            _dependency = _shared_state->create_sink_dependency(
697
101k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
101k
        }
699
117k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
117k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
117k
    }
702
703
117k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
117k
    _rows_input_counter =
708
117k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
117k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
117k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
117k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
117k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
117k
    _memory_used_counter =
714
117k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
117k
    _common_profile->add_info_string("IsColocate",
716
117k
                                     std::to_string(_parent->is_colocated_operator()));
717
117k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
117k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
117k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
117k
    return Status::OK();
721
117k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2
    _operator_profile =
664
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2
    _operator_profile->add_child(_common_profile, true);
673
2
    _operator_profile->add_child(_custom_profile, true);
674
675
2
    _operator_profile->set_metadata(_parent->node_id());
676
2
    _wait_for_finish_dependency_timer =
677
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2
    if constexpr (!is_fake_shared) {
680
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2
            _shared_state = info.shared_state->template cast<SharedState>();
696
2
            _dependency = _shared_state->create_sink_dependency(
697
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2
        }
699
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2
    }
702
703
2
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2
    _rows_input_counter =
708
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2
    _memory_used_counter =
714
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2
    _common_profile->add_info_string("IsColocate",
716
2
                                     std::to_string(_parent->is_colocated_operator()));
717
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2
    return Status::OK();
721
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
155k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
155k
    _operator_profile =
664
155k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
155k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
155k
    _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
155k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
155k
    _operator_profile->add_child(_common_profile, true);
673
155k
    _operator_profile->add_child(_custom_profile, true);
674
675
155k
    _operator_profile->set_metadata(_parent->node_id());
676
155k
    _wait_for_finish_dependency_timer =
677
155k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
155k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
155k
    if constexpr (!is_fake_shared) {
680
155k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
155k
            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
155k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
155k
            _shared_state = info.shared_state->template cast<SharedState>();
696
155k
            _dependency = _shared_state->create_sink_dependency(
697
155k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
155k
        }
699
155k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
155k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
155k
    }
702
703
155k
    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
155k
    _rows_input_counter =
708
155k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
155k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
155k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
155k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
155k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
155k
    _memory_used_counter =
714
155k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
155k
    _common_profile->add_info_string("IsColocate",
716
155k
                                     std::to_string(_parent->is_colocated_operator()));
717
155k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
155k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
155k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
155k
    return Status::OK();
721
155k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
30
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
30
    _operator_profile =
664
30
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
30
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
30
    _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
30
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
30
    _operator_profile->add_child(_common_profile, true);
673
30
    _operator_profile->add_child(_custom_profile, true);
674
675
30
    _operator_profile->set_metadata(_parent->node_id());
676
30
    _wait_for_finish_dependency_timer =
677
30
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
30
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
30
    if constexpr (!is_fake_shared) {
680
30
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
30
            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
30
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
30
            _shared_state = info.shared_state->template cast<SharedState>();
696
30
            _dependency = _shared_state->create_sink_dependency(
697
30
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
30
        }
699
30
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
30
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
30
    }
702
703
30
    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
30
    _rows_input_counter =
708
30
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
30
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
30
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
30
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
30
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
30
    _memory_used_counter =
714
30
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
30
    _common_profile->add_info_string("IsColocate",
716
30
                                     std::to_string(_parent->is_colocated_operator()));
717
30
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
30
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
30
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
30
    return Status::OK();
721
30
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.97k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.97k
    _operator_profile =
664
5.97k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.97k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.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
5.97k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.97k
    _operator_profile->add_child(_common_profile, true);
673
5.97k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.97k
    _operator_profile->set_metadata(_parent->node_id());
676
5.97k
    _wait_for_finish_dependency_timer =
677
5.97k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.97k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.97k
    if constexpr (!is_fake_shared) {
680
5.97k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.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
5.97k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.97k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.97k
            _dependency = _shared_state->create_sink_dependency(
697
5.97k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.97k
        }
699
5.97k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.97k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.97k
    }
702
703
5.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
5.97k
    _rows_input_counter =
708
5.97k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.97k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.97k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.97k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.97k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.97k
    _memory_used_counter =
714
5.97k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.97k
    _common_profile->add_info_string("IsColocate",
716
5.97k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.97k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.97k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.97k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.97k
    return Status::OK();
721
5.97k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.75k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.75k
    _operator_profile =
664
7.75k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.75k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.75k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
7.75k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.75k
    _operator_profile->add_child(_common_profile, true);
673
7.75k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.75k
    _operator_profile->set_metadata(_parent->node_id());
676
7.75k
    _wait_for_finish_dependency_timer =
677
7.75k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.75k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.75k
    if constexpr (!is_fake_shared) {
680
7.75k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.75k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
7.75k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.75k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.75k
            _dependency = _shared_state->create_sink_dependency(
697
7.75k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.75k
        }
699
7.75k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.75k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.75k
    }
702
703
7.75k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
7.75k
    _rows_input_counter =
708
7.75k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.75k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.75k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.75k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.75k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.75k
    _memory_used_counter =
714
7.75k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.75k
    _common_profile->add_info_string("IsColocate",
716
7.75k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.75k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.75k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.75k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.75k
    return Status::OK();
721
7.75k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
84.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
84.8k
    _operator_profile =
664
84.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
84.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
84.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
84.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
84.8k
    _operator_profile->add_child(_common_profile, true);
673
84.8k
    _operator_profile->add_child(_custom_profile, true);
674
675
84.8k
    _operator_profile->set_metadata(_parent->node_id());
676
84.8k
    _wait_for_finish_dependency_timer =
677
84.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
84.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
84.8k
    if constexpr (!is_fake_shared) {
680
84.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
84.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
84.8k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
84.8k
            _shared_state = info.shared_state->template cast<SharedState>();
696
84.8k
            _dependency = _shared_state->create_sink_dependency(
697
84.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
84.8k
        }
699
84.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
84.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
84.8k
    }
702
703
84.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
84.8k
    _rows_input_counter =
708
84.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
84.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
84.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
84.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
84.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
84.8k
    _memory_used_counter =
714
84.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
84.8k
    _common_profile->add_info_string("IsColocate",
716
84.8k
                                     std::to_string(_parent->is_colocated_operator()));
717
84.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
84.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
84.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
84.8k
    return Status::OK();
721
84.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
84.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
84.7k
    _operator_profile =
664
84.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
84.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
84.7k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
84.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
84.7k
    _operator_profile->add_child(_common_profile, true);
673
84.7k
    _operator_profile->add_child(_custom_profile, true);
674
675
84.7k
    _operator_profile->set_metadata(_parent->node_id());
676
84.7k
    _wait_for_finish_dependency_timer =
677
84.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
84.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
84.7k
    if constexpr (!is_fake_shared) {
680
84.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
84.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
84.8k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
84.8k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
84.8k
                                                  ? 0
688
84.8k
                                                  : info.task_idx]
689
84.8k
                                  .get();
690
84.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
84.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
84.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
84.7k
    }
702
703
84.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
84.7k
    _rows_input_counter =
708
84.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
84.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
84.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
84.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
84.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
84.7k
    _memory_used_counter =
714
84.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
84.7k
    _common_profile->add_info_string("IsColocate",
716
84.7k
                                     std::to_string(_parent->is_colocated_operator()));
717
84.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
84.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
84.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
84.7k
    return Status::OK();
721
84.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
32
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
32
    _operator_profile =
664
32
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
32
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
32
    _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
32
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
32
    _operator_profile->add_child(_common_profile, true);
673
32
    _operator_profile->add_child(_custom_profile, true);
674
675
32
    _operator_profile->set_metadata(_parent->node_id());
676
32
    _wait_for_finish_dependency_timer =
677
32
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
32
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
32
    if constexpr (!is_fake_shared) {
680
32
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
32
            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
32
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
32
            _shared_state = info.shared_state->template cast<SharedState>();
696
32
            _dependency = _shared_state->create_sink_dependency(
697
32
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
32
        }
699
32
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
32
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
32
    }
702
703
32
    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
32
    _rows_input_counter =
708
32
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
32
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
32
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
32
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
32
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
32
    _memory_used_counter =
714
32
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
32
    _common_profile->add_info_string("IsColocate",
716
32
                                     std::to_string(_parent->is_colocated_operator()));
717
32
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
32
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
32
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
32
    return Status::OK();
721
32
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
448k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
448k
    _operator_profile =
664
448k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
448k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
448k
    _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
448k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
448k
    _operator_profile->add_child(_common_profile, true);
673
448k
    _operator_profile->add_child(_custom_profile, true);
674
675
448k
    _operator_profile->set_metadata(_parent->node_id());
676
448k
    _wait_for_finish_dependency_timer =
677
448k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
448k
    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
448k
    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
448k
    _rows_input_counter =
708
448k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
448k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
448k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
448k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
448k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
448k
    _memory_used_counter =
714
448k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
448k
    _common_profile->add_info_string("IsColocate",
716
448k
                                     std::to_string(_parent->is_colocated_operator()));
717
448k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
448k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
448k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
448k
    return Status::OK();
721
448k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.39k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.39k
    _operator_profile =
664
5.39k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.39k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.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
5.39k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.39k
    _operator_profile->add_child(_common_profile, true);
673
5.39k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.39k
    _operator_profile->set_metadata(_parent->node_id());
676
5.39k
    _wait_for_finish_dependency_timer =
677
5.39k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.39k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.39k
    if constexpr (!is_fake_shared) {
680
5.39k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.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
5.39k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.39k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.39k
            _dependency = _shared_state->create_sink_dependency(
697
5.39k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.39k
        }
699
5.39k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.39k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.39k
    }
702
703
5.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
5.39k
    _rows_input_counter =
708
5.39k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.39k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.39k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.39k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.39k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.39k
    _memory_used_counter =
714
5.39k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.39k
    _common_profile->add_info_string("IsColocate",
716
5.39k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.39k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.39k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.39k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.39k
    return Status::OK();
721
5.39k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
424
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
424
    _operator_profile =
664
424
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
424
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
424
    _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
424
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
424
    _operator_profile->add_child(_common_profile, true);
673
424
    _operator_profile->add_child(_custom_profile, true);
674
675
424
    _operator_profile->set_metadata(_parent->node_id());
676
424
    _wait_for_finish_dependency_timer =
677
424
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
424
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
424
    if constexpr (!is_fake_shared) {
680
424
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
424
            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
424
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
424
            _shared_state = info.shared_state->template cast<SharedState>();
696
424
            _dependency = _shared_state->create_sink_dependency(
697
424
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
424
        }
699
424
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
424
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
424
    }
702
703
424
    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
424
    _rows_input_counter =
708
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
424
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
424
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
424
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
424
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
424
    _memory_used_counter =
714
424
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
424
    _common_profile->add_info_string("IsColocate",
716
424
                                     std::to_string(_parent->is_colocated_operator()));
717
424
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
424
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
424
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
424
    return Status::OK();
721
424
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.32k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.32k
    _operator_profile =
664
2.32k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.32k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.32k
    _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.32k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.32k
    _operator_profile->add_child(_common_profile, true);
673
2.32k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.32k
    _operator_profile->set_metadata(_parent->node_id());
676
2.32k
    _wait_for_finish_dependency_timer =
677
2.32k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.32k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.32k
    if constexpr (!is_fake_shared) {
680
2.32k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.32k
            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.32k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.32k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.32k
            _dependency = _shared_state->create_sink_dependency(
697
2.32k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.32k
        }
699
2.32k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.32k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.32k
    }
702
703
2.32k
    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.32k
    _rows_input_counter =
708
2.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.32k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.32k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.32k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.32k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.32k
    _memory_used_counter =
714
2.32k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.32k
    _common_profile->add_info_string("IsColocate",
716
2.32k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.32k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.32k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.32k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.32k
    return Status::OK();
721
2.32k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.7k
    _operator_profile =
664
12.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.7k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.7k
    _operator_profile->add_child(_common_profile, true);
673
12.7k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.7k
    _operator_profile->set_metadata(_parent->node_id());
676
12.7k
    _wait_for_finish_dependency_timer =
677
12.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.7k
    if constexpr (!is_fake_shared) {
680
12.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.7k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.7k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.7k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.7k
            _dependency = _shared_state->create_sink_dependency(
697
12.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.7k
        }
699
12.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.7k
    }
702
703
12.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.7k
    _rows_input_counter =
708
12.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.7k
    _memory_used_counter =
714
12.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.7k
    _common_profile->add_info_string("IsColocate",
716
12.7k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.7k
    return Status::OK();
721
12.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
237k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
237k
    _operator_profile =
664
237k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
237k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
237k
    _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
237k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
237k
    _operator_profile->add_child(_common_profile, true);
673
237k
    _operator_profile->add_child(_custom_profile, true);
674
675
237k
    _operator_profile->set_metadata(_parent->node_id());
676
237k
    _wait_for_finish_dependency_timer =
677
237k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
237k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
237k
    if constexpr (!is_fake_shared) {
680
237k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
237k
            info.shared_state_map.end()) {
682
237k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
237k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
237k
            }
685
237k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
237k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
237k
                                                  ? 0
688
237k
                                                  : info.task_idx]
689
237k
                                  .get();
690
237k
            _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
237k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
237k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
237k
    }
702
703
237k
    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
237k
    _rows_input_counter =
708
237k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
237k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
237k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
237k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
237k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
237k
    _memory_used_counter =
714
237k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
237k
    _common_profile->add_info_string("IsColocate",
716
237k
                                     std::to_string(_parent->is_colocated_operator()));
717
237k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
237k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
237k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
237k
    return Status::OK();
721
237k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
429k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
429k
    _operator_profile =
664
429k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
429k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
429k
    _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
429k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
429k
    _operator_profile->add_child(_common_profile, true);
673
429k
    _operator_profile->add_child(_custom_profile, true);
674
675
429k
    _operator_profile->set_metadata(_parent->node_id());
676
429k
    _wait_for_finish_dependency_timer =
677
429k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
429k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
429k
    if constexpr (!is_fake_shared) {
680
429k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
429k
            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
429k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
429k
            _shared_state = info.shared_state->template cast<SharedState>();
696
429k
            _dependency = _shared_state->create_sink_dependency(
697
429k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
429k
        }
699
429k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
429k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
429k
    }
702
703
429k
    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
429k
    _rows_input_counter =
708
429k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
429k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
429k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
429k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
429k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
429k
    _memory_used_counter =
714
429k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
429k
    _common_profile->add_info_string("IsColocate",
716
429k
                                     std::to_string(_parent->is_colocated_operator()));
717
429k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
429k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
429k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
429k
    return Status::OK();
721
429k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
25
    _operator_profile =
664
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
25
    _operator_profile->add_child(_common_profile, true);
673
25
    _operator_profile->add_child(_custom_profile, true);
674
675
25
    _operator_profile->set_metadata(_parent->node_id());
676
25
    _wait_for_finish_dependency_timer =
677
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
25
    if constexpr (!is_fake_shared) {
680
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
25
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
25
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
25
            _shared_state = info.shared_state->template cast<SharedState>();
696
25
            _dependency = _shared_state->create_sink_dependency(
697
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
25
        }
699
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
25
    }
702
703
25
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
25
    _rows_input_counter =
708
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
25
    _memory_used_counter =
714
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
25
    _common_profile->add_info_string("IsColocate",
716
25
                                     std::to_string(_parent->is_colocated_operator()));
717
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
25
    return Status::OK();
721
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
328
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
328
    _operator_profile =
664
328
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
328
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
328
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
328
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
328
    _operator_profile->add_child(_common_profile, true);
673
328
    _operator_profile->add_child(_custom_profile, true);
674
675
328
    _operator_profile->set_metadata(_parent->node_id());
676
328
    _wait_for_finish_dependency_timer =
677
328
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
328
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
328
    if constexpr (!is_fake_shared) {
680
328
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
328
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
328
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
328
            _shared_state = info.shared_state->template cast<SharedState>();
696
328
            _dependency = _shared_state->create_sink_dependency(
697
328
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
328
        }
699
328
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
328
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
328
    }
702
703
328
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
328
    _rows_input_counter =
708
328
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
328
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
328
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
328
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
328
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
328
    _memory_used_counter =
714
328
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
328
    _common_profile->add_info_string("IsColocate",
716
328
                                     std::to_string(_parent->is_colocated_operator()));
717
328
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
328
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
328
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
328
    return Status::OK();
721
328
}
722
723
template <typename SharedState>
724
1.60M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.60M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.60M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.14M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.14M
    }
731
1.60M
    _closed = true;
732
1.60M
    return Status::OK();
733
1.60M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
117k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
117k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
117k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
117k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
117k
    }
731
117k
    _closed = true;
732
117k
    return Status::OK();
733
117k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1
    }
731
1
    _closed = true;
732
1
    return Status::OK();
733
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
155k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
155k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
155k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
155k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
155k
    }
731
155k
    _closed = true;
732
155k
    return Status::OK();
733
155k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
21
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
21
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
19
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
19
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
19
    }
731
19
    _closed = true;
732
19
    return Status::OK();
733
21
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.95k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.95k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.95k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.95k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.95k
    }
731
5.95k
    _closed = true;
732
5.95k
    return Status::OK();
733
5.95k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.73k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.73k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.73k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.73k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.73k
    }
731
7.73k
    _closed = true;
732
7.73k
    return Status::OK();
733
7.73k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
84.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
84.7k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
84.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
84.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
84.7k
    }
731
84.7k
    _closed = true;
732
84.7k
    return Status::OK();
733
84.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
84.3k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
84.3k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
84.3k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
84.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
84.3k
    }
731
84.3k
    _closed = true;
732
84.3k
    return Status::OK();
733
84.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
21
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
21
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
21
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
21
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
21
    }
731
21
    _closed = true;
732
21
    return Status::OK();
733
21
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
453k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
453k
    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
453k
    _closed = true;
732
453k
    return Status::OK();
733
453k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.40k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.40k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.40k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.40k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.40k
    }
731
5.40k
    _closed = true;
732
5.40k
    return Status::OK();
733
5.40k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
319
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
319
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
319
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
319
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
319
    }
731
319
    _closed = true;
732
319
    return Status::OK();
733
319
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.34k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.34k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.34k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.34k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.34k
    }
731
2.34k
    _closed = true;
732
2.34k
    return Status::OK();
733
2.34k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.8k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.8k
    }
731
12.8k
    _closed = true;
732
12.8k
    return Status::OK();
733
12.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
238k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
238k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
238k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
238k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
238k
    }
731
238k
    _closed = true;
732
238k
    return Status::OK();
733
238k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
432k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
432k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
432k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
432k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
432k
    }
731
432k
    _closed = true;
732
432k
    return Status::OK();
733
432k
}
_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
328
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
328
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
328
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
328
    }
731
328
    _closed = true;
732
328
    return Status::OK();
733
328
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
4.15k
                                                          bool* eos) {
738
4.15k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.15k
    return pull(state, block, eos);
740
4.15k
}
_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.12k
                                                          bool* eos) {
738
4.12k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.11k
    return pull(state, block, eos);
740
4.12k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
572k
                                                         bool* eos) {
745
572k
    auto& local_state = get_local_state(state);
746
572k
    if (need_more_input_data(state)) {
747
541k
        local_state._child_block->clear_column_data(
748
541k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
541k
                        .num_materialized_slots());
750
541k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
541k
                state, local_state._child_block.get(), &local_state._child_eos));
752
541k
        *eos = local_state._child_eos;
753
541k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
78.5k
            return Status::OK();
755
78.5k
        }
756
463k
        {
757
463k
            SCOPED_TIMER(local_state.exec_time_counter());
758
463k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
463k
        }
760
463k
    }
761
762
494k
    if (!need_more_input_data(state)) {
763
466k
        SCOPED_TIMER(local_state.exec_time_counter());
764
466k
        bool new_eos = false;
765
466k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
466k
        if (new_eos) {
767
389k
            *eos = true;
768
389k
        } else if (!need_more_input_data(state)) {
769
22.7k
            *eos = false;
770
22.7k
        }
771
466k
    }
772
494k
    return Status::OK();
773
494k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
138k
                                                         bool* eos) {
745
138k
    auto& local_state = get_local_state(state);
746
138k
    if (need_more_input_data(state)) {
747
120k
        local_state._child_block->clear_column_data(
748
120k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
120k
                        .num_materialized_slots());
750
120k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
120k
                state, local_state._child_block.get(), &local_state._child_eos));
752
120k
        *eos = local_state._child_eos;
753
120k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
36.4k
            return Status::OK();
755
36.4k
        }
756
83.5k
        {
757
83.5k
            SCOPED_TIMER(local_state.exec_time_counter());
758
83.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
83.5k
        }
760
83.5k
    }
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
45.2k
            *eos = true;
768
56.3k
        } else if (!need_more_input_data(state)) {
769
8.90k
            *eos = false;
770
8.90k
        }
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.04k
                                                         bool* eos) {
745
4.04k
    auto& local_state = get_local_state(state);
746
4.04k
    if (need_more_input_data(state)) {
747
2.21k
        local_state._child_block->clear_column_data(
748
2.21k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.21k
                        .num_materialized_slots());
750
2.21k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.21k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.21k
        *eos = local_state._child_eos;
753
2.21k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
391
            return Status::OK();
755
391
        }
756
1.82k
        {
757
1.82k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.82k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.82k
        }
760
1.82k
    }
761
762
3.66k
    if (!need_more_input_data(state)) {
763
3.66k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.66k
        bool new_eos = false;
765
3.66k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.66k
        if (new_eos) {
767
1.26k
            *eos = true;
768
2.39k
        } else if (!need_more_input_data(state)) {
769
1.82k
            *eos = false;
770
1.82k
        }
771
3.66k
    }
772
3.65k
    return Status::OK();
773
3.65k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.85k
                                                         bool* eos) {
745
1.85k
    auto& local_state = get_local_state(state);
746
1.85k
    if (need_more_input_data(state)) {
747
1.85k
        local_state._child_block->clear_column_data(
748
1.85k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.85k
                        .num_materialized_slots());
750
1.85k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.85k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.85k
        *eos = local_state._child_eos;
753
1.85k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
768
            return Status::OK();
755
768
        }
756
1.08k
        {
757
1.08k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.08k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.08k
        }
760
1.08k
    }
761
762
1.08k
    if (!need_more_input_data(state)) {
763
1.08k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.08k
        bool new_eos = false;
765
1.08k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.08k
        if (new_eos) {
767
788
            *eos = true;
768
788
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.08k
    }
772
1.08k
    return Status::OK();
773
1.08k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
16.9k
                                                         bool* eos) {
745
16.9k
    auto& local_state = get_local_state(state);
746
17.0k
    if (need_more_input_data(state)) {
747
17.0k
        local_state._child_block->clear_column_data(
748
17.0k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
17.0k
                        .num_materialized_slots());
750
17.0k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
17.0k
                state, local_state._child_block.get(), &local_state._child_eos));
752
17.0k
        *eos = local_state._child_eos;
753
17.0k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
4.49k
            return Status::OK();
755
4.49k
        }
756
12.5k
        {
757
12.5k
            SCOPED_TIMER(local_state.exec_time_counter());
758
12.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
12.5k
        }
760
12.5k
    }
761
762
12.5k
    if (!need_more_input_data(state)) {
763
5.55k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.55k
        bool new_eos = false;
765
5.55k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.55k
        if (new_eos) {
767
5.47k
            *eos = true;
768
5.47k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
5.55k
    }
772
12.5k
    return Status::OK();
773
12.5k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
382k
                                                         bool* eos) {
745
382k
    auto& local_state = get_local_state(state);
746
383k
    if (need_more_input_data(state)) {
747
383k
        local_state._child_block->clear_column_data(
748
383k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
383k
                        .num_materialized_slots());
750
383k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
383k
                state, local_state._child_block.get(), &local_state._child_eos));
752
383k
        *eos = local_state._child_eos;
753
383k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
34.9k
            return Status::OK();
755
34.9k
        }
756
348k
        {
757
348k
            SCOPED_TIMER(local_state.exec_time_counter());
758
348k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
348k
        }
760
348k
    }
761
762
347k
    if (!need_more_input_data(state)) {
763
327k
        SCOPED_TIMER(local_state.exec_time_counter());
764
327k
        bool new_eos = false;
765
327k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
327k
        if (new_eos) {
767
326k
            *eos = true;
768
326k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
327k
    }
772
347k
    return Status::OK();
773
347k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
21.9k
                                                         bool* eos) {
745
21.9k
    auto& local_state = get_local_state(state);
746
21.9k
    if (need_more_input_data(state)) {
747
10.2k
        local_state._child_block->clear_column_data(
748
10.2k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.2k
                        .num_materialized_slots());
750
10.2k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.2k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.2k
        *eos = local_state._child_eos;
753
10.2k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
634
            return Status::OK();
755
634
        }
756
9.58k
        {
757
9.58k
            SCOPED_TIMER(local_state.exec_time_counter());
758
9.58k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
9.58k
        }
760
9.58k
    }
761
762
21.2k
    if (!need_more_input_data(state)) {
763
20.7k
        SCOPED_TIMER(local_state.exec_time_counter());
764
20.7k
        bool new_eos = false;
765
20.7k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
20.7k
        if (new_eos) {
767
5.97k
            *eos = true;
768
14.7k
        } else if (!need_more_input_data(state)) {
769
11.7k
            *eos = false;
770
11.7k
        }
771
20.7k
    }
772
21.2k
    return Status::OK();
773
21.2k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
6.88k
                                                         bool* eos) {
745
6.88k
    auto& local_state = get_local_state(state);
746
6.88k
    if (need_more_input_data(state)) {
747
6.52k
        local_state._child_block->clear_column_data(
748
6.52k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.52k
                        .num_materialized_slots());
750
6.52k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.52k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.52k
        *eos = local_state._child_eos;
753
6.52k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
825
            return Status::OK();
755
825
        }
756
5.69k
        {
757
5.69k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.69k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.69k
        }
760
5.69k
    }
761
762
6.05k
    if (!need_more_input_data(state)) {
763
6.05k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.05k
        bool new_eos = false;
765
6.05k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.05k
        if (new_eos) {
767
4.05k
            *eos = true;
768
4.05k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.05k
    }
772
6.05k
    return Status::OK();
773
6.05k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
43.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
43.7k
    RETURN_IF_ERROR(Base::init(state, info));
779
43.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
43.7k
                                                         "AsyncWriterDependency", true);
781
43.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
43.7k
                             _finish_dependency));
783
784
43.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
43.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
43.7k
    return Status::OK();
787
43.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
353
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
353
    RETURN_IF_ERROR(Base::init(state, info));
779
353
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
353
                                                         "AsyncWriterDependency", true);
781
353
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
353
                             _finish_dependency));
783
784
353
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
353
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
353
    return Status::OK();
787
353
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
43.3k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
43.3k
    RETURN_IF_ERROR(Base::init(state, info));
779
43.3k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
43.3k
                                                         "AsyncWriterDependency", true);
781
43.3k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
43.3k
                             _finish_dependency));
783
784
43.3k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
43.3k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
43.3k
    return Status::OK();
787
43.3k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
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
44.1k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
44.1k
    RETURN_IF_ERROR(Base::open(state));
793
44.1k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
344k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
300k
        RETURN_IF_ERROR(
796
300k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
300k
    }
798
44.1k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
44.1k
    return Status::OK();
800
44.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
353
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
353
    RETURN_IF_ERROR(Base::open(state));
793
353
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.83k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.48k
        RETURN_IF_ERROR(
796
1.48k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.48k
    }
798
353
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
353
    return Status::OK();
800
353
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
43.8k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
43.8k
    RETURN_IF_ERROR(Base::open(state));
793
43.8k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
342k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
298k
        RETURN_IF_ERROR(
796
298k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
298k
    }
798
43.8k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
43.8k
    return Status::OK();
800
43.8k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
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
59.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
59.0k
    return _writer->sink(block, eos);
806
59.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.60k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.60k
    return _writer->sink(block, eos);
806
1.60k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
57.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
57.4k
    return _writer->sink(block, eos);
806
57.4k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
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
44.2k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
44.2k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
44.2k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
44.2k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
44.2k
    if (_writer) {
818
44.2k
        Status st = _writer->get_writer_status();
819
44.2k
        if (exec_status.ok()) {
820
44.2k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
44.2k
                                                       : Status::Cancelled("force close"));
822
44.2k
        } else {
823
75
            _writer->force_close(exec_status);
824
75
        }
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
44.2k
        RETURN_IF_ERROR(st);
829
44.2k
    }
830
44.1k
    return Base::close(state, exec_status);
831
44.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
341
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
341
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
341
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
341
    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
341
    if (_writer) {
818
341
        Status st = _writer->get_writer_status();
819
341
        if (exec_status.ok()) {
820
341
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
341
                                                       : Status::Cancelled("force close"));
822
341
        } 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
341
        RETURN_IF_ERROR(st);
829
341
    }
830
341
    return Base::close(state, exec_status);
831
341
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
43.9k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
43.9k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
43.9k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
43.9k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
43.9k
    if (_writer) {
818
43.9k
        Status st = _writer->get_writer_status();
819
43.9k
        if (exec_status.ok()) {
820
43.8k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
43.8k
                                                       : Status::Cancelled("force close"));
822
43.8k
        } else {
823
75
            _writer->force_close(exec_status);
824
75
        }
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
43.9k
        RETURN_IF_ERROR(st);
829
43.9k
    }
830
43.8k
    return Base::close(state, exec_status);
831
43.9k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
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