Coverage Report

Created: 2026-09-17 13:38

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/paimon_table_sink_operator.h"
68
#include "exec/operator/partition_sort_sink_operator.h"
69
#include "exec/operator/partition_sort_source_operator.h"
70
#include "exec/operator/partitioned_aggregation_sink_operator.h"
71
#include "exec/operator/partitioned_aggregation_source_operator.h"
72
#include "exec/operator/partitioned_hash_join_probe_operator.h"
73
#include "exec/operator/partitioned_hash_join_sink_operator.h"
74
#include "exec/operator/rec_cte_anchor_sink_operator.h"
75
#include "exec/operator/rec_cte_scan_operator.h"
76
#include "exec/operator/rec_cte_sink_operator.h"
77
#include "exec/operator/rec_cte_source_operator.h"
78
#include "exec/operator/repeat_operator.h"
79
#include "exec/operator/result_file_sink_operator.h"
80
#include "exec/operator/result_sink_operator.h"
81
#include "exec/operator/schema_scan_operator.h"
82
#include "exec/operator/select_operator.h"
83
#include "exec/operator/set_probe_sink_operator.h"
84
#include "exec/operator/set_sink_operator.h"
85
#include "exec/operator/set_source_operator.h"
86
#include "exec/operator/sort_sink_operator.h"
87
#include "exec/operator/sort_source_operator.h"
88
#include "exec/operator/spill_iceberg_table_sink_operator.h"
89
#include "exec/operator/spill_sort_sink_operator.h"
90
#include "exec/operator/spill_sort_source_operator.h"
91
#include "exec/operator/streaming_aggregation_operator.h"
92
#include "exec/operator/table_function_operator.h"
93
#include "exec/operator/tvf_table_sink_operator.h"
94
#include "exec/operator/union_sink_operator.h"
95
#include "exec/operator/union_source_operator.h"
96
#include "exec/pipeline/dependency.h"
97
#include "exec/pipeline/pipeline.h"
98
#include "exprs/vexpr.h"
99
#include "exprs/vexpr_context.h"
100
#include "runtime/runtime_profile.h"
101
#include "runtime/runtime_profile_counter_names.h"
102
#include "util/debug_util.h"
103
#include "util/string_util.h"
104
105
namespace doris {
106
class RowDescriptor;
107
class RuntimeState;
108
} // namespace doris
109
110
namespace doris {
111
112
0
Status OperatorBase::close(RuntimeState* state) {
113
0
    if (_is_closed) {
114
0
        return Status::OK();
115
0
    }
116
0
    _is_closed = true;
117
0
    return Status::OK();
118
0
}
119
120
template <typename SharedStateArg>
121
1.69M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
1.69M
    if (_parent->nereids_id() == -1) {
123
874k
        return fmt::format("(id={})", _parent->node_id());
124
874k
    } else {
125
817k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
817k
    }
127
1.69M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
65.3k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
65.3k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
65.3k
    } else {
125
65.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
65.3k
    }
127
65.3k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
1
    if (_parent->nereids_id() == -1) {
123
1
        return fmt::format("(id={})", _parent->node_id());
124
1
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
220k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
220k
    if (_parent->nereids_id() == -1) {
123
12
        return fmt::format("(id={})", _parent->node_id());
124
220k
    } else {
125
220k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
220k
    }
127
220k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
26
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
26
    } else {
125
26
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
26
    }
127
26
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
5.90k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
5.90k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
5.90k
    } else {
125
5.90k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
5.90k
    }
127
5.90k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
7.49k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
7.49k
    if (_parent->nereids_id() == -1) {
123
12
        return fmt::format("(id={})", _parent->node_id());
124
7.48k
    } else {
125
7.48k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
7.48k
    }
127
7.49k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
83.3k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
83.3k
    if (_parent->nereids_id() == -1) {
123
29
        return fmt::format("(id={})", _parent->node_id());
124
83.3k
    } else {
125
83.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
83.3k
    }
127
83.3k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
61.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
61.1k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
61.1k
    } else {
125
61.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
61.1k
    }
127
61.1k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
20
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
20
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
20
    } else {
125
20
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
20
    }
127
20
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
585k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
585k
    if (_parent->nereids_id() == -1) {
123
271k
        return fmt::format("(id={})", _parent->node_id());
124
314k
    } else {
125
314k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
314k
    }
127
585k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
54.3k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
54.3k
    if (_parent->nereids_id() == -1) {
123
2
        return fmt::format("(id={})", _parent->node_id());
124
54.3k
    } else {
125
54.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
54.3k
    }
127
54.3k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
26
    if (_parent->nereids_id() == -1) {
123
26
        return fmt::format("(id={})", _parent->node_id());
124
26
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
4.46k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
4.46k
    if (_parent->nereids_id() == -1) {
123
4.45k
        return fmt::format("(id={})", _parent->node_id());
124
4.45k
    } else {
125
5
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
5
    }
127
4.46k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
576
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
576
    if (_parent->nereids_id() == -1) {
123
102
        return fmt::format("(id={})", _parent->node_id());
124
474
    } else {
125
474
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
474
    }
127
576
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
5.24k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
5.24k
    if (_parent->nereids_id() == -1) {
123
13
        return fmt::format("(id={})", _parent->node_id());
124
5.22k
    } else {
125
5.22k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
5.22k
    }
127
5.24k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
597k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
598k
    if (_parent->nereids_id() == -1) {
123
598k
        return fmt::format("(id={})", _parent->node_id());
124
18.4E
    } else {
125
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
18.4E
    }
127
597k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
169
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
169
    } else {
125
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
169
    }
127
169
}
128
129
template <typename SharedStateArg>
130
1.14M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
1.14M
    if (_parent->nereids_id() == -1) {
132
644k
        return fmt::format("(id={})", _parent->node_id());
133
644k
    } else {
134
501k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
501k
    }
136
1.14M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
113k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
113k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
113k
    } else {
134
113k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
113k
    }
136
113k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
2
    if (_parent->nereids_id() == -1) {
132
1
        return fmt::format("(id={})", _parent->node_id());
133
1
    } else {
134
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
1
    }
136
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
221k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
221k
    if (_parent->nereids_id() == -1) {
132
9
        return fmt::format("(id={})", _parent->node_id());
133
221k
    } else {
134
221k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
221k
    }
136
221k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
33
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
33
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
33
    } else {
134
33
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
33
    }
136
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
5.90k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
5.90k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
5.90k
    } else {
134
5.90k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
5.90k
    }
136
5.90k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
7.51k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
7.51k
    if (_parent->nereids_id() == -1) {
132
12
        return fmt::format("(id={})", _parent->node_id());
133
7.50k
    } else {
134
7.50k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
7.50k
    }
136
7.51k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
83.6k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
83.6k
    if (_parent->nereids_id() == -1) {
132
29
        return fmt::format("(id={})", _parent->node_id());
133
83.6k
    } else {
134
83.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
83.6k
    }
136
83.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
61.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
61.0k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
61.0k
    } else {
134
61.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
61.0k
    }
136
61.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
30
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
30
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
30
    } else {
134
30
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
30
    }
136
30
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
21
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
21
    if (_parent->nereids_id() == -1) {
132
21
        return fmt::format("(id={})", _parent->node_id());
133
21
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
21
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
8.45k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
8.45k
    if (_parent->nereids_id() == -1) {
132
3
        return fmt::format("(id={})", _parent->node_id());
133
8.45k
    } else {
134
8.45k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
8.45k
    }
136
8.45k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
578
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
578
    if (_parent->nereids_id() == -1) {
132
102
        return fmt::format("(id={})", _parent->node_id());
133
476
    } else {
134
476
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
476
    }
136
578
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
12.6k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
12.6k
    if (_parent->nereids_id() == -1) {
132
12.6k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
229k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
229k
    if (_parent->nereids_id() == -1) {
132
229k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
229k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
400k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
401k
    if (_parent->nereids_id() == -1) {
132
401k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
400k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
25
    if (_parent->nereids_id() == -1) {
132
25
        return fmt::format("(id={})", _parent->node_id());
133
25
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
338
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
338
    } else {
134
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
338
    }
136
338
}
137
138
template <typename SharedStateArg>
139
30.8k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
30.8k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
30.8k
    _terminated = true;
144
30.8k
    return Status::OK();
145
30.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
24.0k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
24.0k
    _terminated = true;
144
24.0k
    return Status::OK();
145
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
2.48k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
2.48k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
2.48k
    _terminated = true;
144
2.48k
    return Status::OK();
145
2.48k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
3
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
3
    _terminated = true;
144
3
    return Status::OK();
145
3
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
6
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
6
    _terminated = true;
144
6
    return Status::OK();
145
6
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
2.08k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
2.08k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
2.08k
    _terminated = true;
144
2.08k
    return Status::OK();
145
2.08k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
1.00k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
1.00k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
1.00k
    _terminated = true;
144
1.00k
    return Status::OK();
145
1.00k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
264
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
264
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
264
    _terminated = true;
144
264
    return Status::OK();
145
264
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
280
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
280
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
280
    _terminated = true;
144
280
    return Status::OK();
145
280
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
5
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
5
    _terminated = true;
144
5
    return Status::OK();
145
5
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
157
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
157
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
157
    _terminated = true;
144
157
    return Status::OK();
145
157
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
12
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
12
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
12
    _terminated = true;
144
12
    return Status::OK();
145
12
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
294
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
294
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
294
    _terminated = true;
144
294
    return Status::OK();
145
294
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
134
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
134
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
134
    _terminated = true;
144
134
    return Status::OK();
145
134
}
146
147
297k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
148
297k
    return _child && _child->is_serial_operator() && !is_source()
149
297k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
150
297k
                   : DataDistribution(TLocalPartitionType::NOOP);
151
297k
}
152
153
24.6k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
154
24.6k
    if (!_child) {
155
23.6k
        return false;
156
23.6k
    }
157
998
    if (_child->is_serial_operator()) {
158
99
        return true;
159
99
    }
160
899
    const auto child_distribution = _child->required_data_distribution(state);
161
899
    return child_distribution.need_local_exchange() &&
162
899
           !is_shuffled_exchange(child_distribution.distribution_type);
163
998
}
164
165
template <typename SharedStateArg>
166
16.9k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
16.9k
    fmt::memory_buffer debug_string_buffer;
168
16.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
16.9k
    return fmt::to_string(debug_string_buffer);
170
16.9k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
166
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
3
    fmt::memory_buffer debug_string_buffer;
168
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
3
    return fmt::to_string(debug_string_buffer);
170
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
166
16.9k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
16.9k
    fmt::memory_buffer debug_string_buffer;
168
16.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
16.9k
    return fmt::to_string(debug_string_buffer);
170
16.9k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
166
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
1
    fmt::memory_buffer debug_string_buffer;
168
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
1
    return fmt::to_string(debug_string_buffer);
170
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
171
172
template <typename SharedStateArg>
173
16.9k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
174
16.9k
    fmt::memory_buffer debug_string_buffer;
175
16.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
176
16.9k
    return fmt::to_string(debug_string_buffer);
177
16.9k
}
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
173
16.9k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
174
16.9k
    fmt::memory_buffer debug_string_buffer;
175
16.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
176
16.9k
    return fmt::to_string(debug_string_buffer);
177
16.9k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
178
179
16.9k
std::string OperatorXBase::debug_string(int indentation_level) const {
180
16.9k
    fmt::memory_buffer debug_string_buffer;
181
16.9k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
182
16.9k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
183
16.9k
                   _is_serial_operator);
184
16.9k
    return fmt::to_string(debug_string_buffer);
185
16.9k
}
186
187
16.9k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
188
16.9k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
189
16.9k
}
190
191
650k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
192
650k
    std::string node_name = print_plan_node_type(tnode.node_type);
193
650k
    _nereids_id = tnode.nereids_id;
194
650k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
195
3.85k
        if (!has_projection()) {
196
0
            return Status::InternalError("no final output tuple id");
197
0
        }
198
3.85k
        if (tnode.intermediate_output_tuple_id_list.size() !=
199
3.85k
            tnode.intermediate_projections_list.size()) {
200
0
            return Status::InternalError(
201
0
                    "intermediate_output_tuple_id_list size:{} not match "
202
0
                    "intermediate_projections_list size:{}",
203
0
                    tnode.intermediate_output_tuple_id_list.size(),
204
0
                    tnode.intermediate_projections_list.size());
205
0
        }
206
3.85k
    }
207
650k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
208
650k
    _op_name = substr + "_OPERATOR";
209
210
650k
    if (tnode.__isset.vconjunct) {
211
0
        return Status::InternalError("vconjunct is not supported yet");
212
650k
    } else if (tnode.__isset.conjuncts) {
213
272k
        for (const auto& conjunct : tnode.conjuncts) {
214
272k
            VExprContextSPtr context;
215
272k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
216
272k
            _conjuncts.emplace_back(context);
217
272k
        }
218
98.9k
    }
219
220
    // create the projections expr
221
650k
    if (tnode.__isset.projections) {
222
259k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
223
259k
    }
224
650k
    if (!tnode.intermediate_projections_list.empty()) {
225
3.85k
        DCHECK(has_projection()) << "no final projections";
226
3.85k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
227
6.44k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
228
6.44k
            VExprContextSPtrs projections;
229
6.44k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
230
6.44k
            _projection->intermediate_projections.push_back(projections);
231
6.44k
        }
232
3.85k
    }
233
650k
    return Status::OK();
234
650k
}
235
236
677k
Status OperatorXBase::prepare(RuntimeState* state) {
237
677k
    for (auto& conjunct : _conjuncts) {
238
272k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
239
272k
    }
240
677k
    if (state->enable_adjust_conjunct_order_by_cost()) {
241
627k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
242
339k
            return a->execute_cost() < b->execute_cost();
243
339k
        });
244
627k
    };
245
246
677k
    if (has_projection()) {
247
258k
        auto& projection = *_projection;
248
265k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
249
6.43k
            const auto& input_row_desc =
250
6.43k
                    i == 0 ? operator_row_desc_before_projection()
251
6.43k
                           : projection.intermediate_output_row_descriptors[i - 1];
252
6.43k
            RETURN_IF_ERROR(
253
6.43k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
254
6.43k
        }
255
258k
        const auto& final_projection_input_row_desc =
256
258k
                projection.intermediate_output_row_descriptors.empty()
257
258k
                        ? operator_row_desc_before_projection()
258
258k
                        : projection.intermediate_output_row_descriptors.back();
259
258k
        RETURN_IF_ERROR(
260
258k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
261
258k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
262
258k
                                                      projection.output_row_descriptor));
263
258k
    }
264
265
677k
    for (auto& conjunct : _conjuncts) {
266
272k
        RETURN_IF_ERROR(conjunct->open(state));
267
272k
    }
268
677k
    if (has_projection()) {
269
259k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
270
258k
        for (auto& projections : _projection->intermediate_projections) {
271
6.44k
            RETURN_IF_ERROR(VExpr::open(projections, state));
272
6.44k
        }
273
258k
    }
274
677k
    if (_child && !is_source()) {
275
98.6k
        RETURN_IF_ERROR(_child->prepare(state));
276
98.6k
    }
277
278
677k
    if (VExpr::contains_blockable_function(_conjuncts) ||
279
677k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
280
0
        _blockable = true;
281
0
    }
282
283
677k
    return Status::OK();
284
677k
}
285
286
7.62k
Status OperatorXBase::terminate(RuntimeState* state) {
287
7.62k
    if (_child && !is_source()) {
288
823
        RETURN_IF_ERROR(_child->terminate(state));
289
823
    }
290
7.62k
    auto result = state->get_local_state_result(operator_id());
291
7.62k
    if (!result) {
292
0
        return result.error();
293
0
    }
294
7.62k
    return result.value()->terminate(state);
295
7.62k
}
296
297
4.59M
Status OperatorXBase::close(RuntimeState* state) {
298
4.59M
    if (_child && !is_source()) {
299
749k
        RETURN_IF_ERROR(_child->close(state));
300
749k
    }
301
4.59M
    auto result = state->get_local_state_result(operator_id());
302
4.59M
    if (!result) {
303
0
        return result.error();
304
0
    }
305
4.59M
    return result.value()->close(state);
306
4.59M
}
307
308
281k
void PipelineXLocalStateBase::clear_origin_block() {
309
281k
    _origin_block.clear_column_data(
310
281k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
311
281k
}
312
313
705k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
314
705k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
315
316
705k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
317
705k
    return Status::OK();
318
705k
}
319
320
0
bool PipelineXLocalStateBase::is_blockable() const {
321
0
    return std::any_of(_projections.begin(), _projections.end(),
322
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
323
0
}
324
325
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
326
281k
                                     Block* output_block) const {
327
281k
    auto* local_state = state->get_local_state(operator_id());
328
281k
    SCOPED_TIMER(local_state->exec_time_counter());
329
281k
    SCOPED_TIMER(local_state->_projection_timer);
330
281k
    const size_t rows = origin_block->rows();
331
281k
    if (rows == 0) {
332
146k
        return Status::OK();
333
146k
    }
334
134k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
335
336
134k
    {
337
134k
        Block input_block = *origin_block;
338
339
134k
        ColumnsWithTypeAndName new_columns;
340
134k
        for (const auto& projections : local_state->_intermediate_projections) {
341
3.45k
            if (projections.empty()) {
342
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
343
0
                                             node_id());
344
0
            }
345
3.45k
            new_columns.resize(projections.size());
346
66.7k
            for (int i = 0; i < projections.size(); i++) {
347
63.3k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
348
63.3k
                if (new_columns[i].column->size() != rows) {
349
0
                    return Status::InternalError(
350
0
                            "intermediate projection result column size {} not equal input rows "
351
0
                            "{}, expr: {}",
352
0
                            new_columns[i].column->size(), rows,
353
0
                            projections[i]->root()->debug_string());
354
0
                }
355
63.3k
            }
356
3.44k
            Block tmp_block {new_columns};
357
3.44k
            input_block.swap(tmp_block);
358
3.44k
        }
359
360
134k
        if (input_block.rows() != rows) {
361
0
            return Status::InternalError(
362
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
363
0
                    "input_block: {}",
364
0
                    input_block.rows(), rows, input_block.dump_structure());
365
0
        }
366
367
134k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
368
134k
                output_block, _projection->output_row_descriptor);
369
134k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
370
134k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
371
134k
        Columns shared_columns(mutable_columns.size());
372
373
764k
        for (int i = 0; i < mutable_columns.size(); ++i) {
374
629k
            ColumnPtr column_ptr;
375
629k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
376
629k
            if (column_ptr->size() != rows) {
377
0
                return Status::InternalError(
378
0
                        "projection result column size {} not equal input rows {}, expr: {}",
379
0
                        column_ptr->size(), rows,
380
0
                        local_state->_projections[i]->root()->debug_string());
381
0
            }
382
629k
            column_ptr = column_ptr->convert_to_full_column_if_const();
383
629k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
384
0
                column_ptr = make_nullable(column_ptr, false);
385
0
            }
386
629k
            if (column_ptr->is_exclusive()) {
387
223k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
388
405k
            } else {
389
405k
                shared_columns[i] = std::move(column_ptr);
390
405k
            }
391
629k
        }
392
393
134k
        scoped_mutable_block.restore();
394
764k
        for (int i = 0; i < shared_columns.size(); ++i) {
395
629k
            if (shared_columns[i]) {
396
405k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
397
405k
            }
398
629k
        }
399
134k
    }
400
401
0
    origin_block->clear_column_data(
402
134k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
403
134k
    DCHECK_EQ(output_block->rows(), rows);
404
405
134k
    return Status::OK();
406
134k
}
407
408
3.99M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
409
3.99M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
410
3.99M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
411
3.99M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
412
3.99M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
413
3.99M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
414
3.99M
            if (_debug_point_count++ % 2 == 0) {
415
3.99M
                return Status::OK();
416
3.99M
            }
417
3.99M
        }
418
3.99M
    });
419
420
3.99M
    Status status;
421
3.99M
    auto* local_state = state->get_local_state(operator_id());
422
3.99M
    Defer defer([&]() {
423
3.99M
        if (status.ok()) {
424
3.99M
            local_state->update_output_block_counters(*block);
425
3.99M
        }
426
3.99M
    });
427
3.99M
    if (has_projection()) {
428
281k
        local_state->clear_origin_block();
429
281k
        status = get_block(state, &local_state->_origin_block, eos);
430
281k
        if (UNLIKELY(!status.ok())) {
431
26
            return status;
432
26
        }
433
281k
        status = do_projections(state, &local_state->_origin_block, block);
434
281k
        return status;
435
281k
    }
436
3.71M
    status = get_block(state, block, eos);
437
3.71M
    RETURN_IF_ERROR(block->check_type_and_column());
438
3.71M
    return status;
439
3.71M
}
440
441
2.63M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
442
2.63M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
443
9.55k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
444
9.55k
        *eos = true;
445
9.55k
    }
446
447
2.63M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
448
2.63M
        auto op_name = to_lower(_parent->_op_name);
449
2.63M
        auto arg_op_name = dp->param<std::string>("op_name");
450
2.63M
        arg_op_name = to_lower(arg_op_name);
451
452
2.63M
        if (op_name == arg_op_name) {
453
2.63M
            *eos = true;
454
2.63M
        }
455
2.63M
    });
456
457
2.63M
    if (auto rows = block->rows()) {
458
718k
        _num_rows_returned += rows;
459
718k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
460
718k
    }
461
2.63M
}
462
463
30.8k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
464
30.8k
    auto result = state->get_sink_local_state_result();
465
30.8k
    if (!result) {
466
0
        return result.error();
467
0
    }
468
30.8k
    return result.value()->terminate(state);
469
30.8k
}
470
471
16.9k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
472
16.9k
    fmt::memory_buffer debug_string_buffer;
473
474
16.9k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
475
16.9k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
476
16.9k
    return fmt::to_string(debug_string_buffer);
477
16.9k
}
478
479
16.9k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
480
16.9k
    return state->get_sink_local_state()->debug_string(indentation_level);
481
16.9k
}
482
483
340k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
484
340k
    std::string op_name = "UNKNOWN_SINK";
485
340k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
486
487
341k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
488
341k
        op_name = it->second;
489
341k
    }
490
340k
    _name = op_name + "_OPERATOR";
491
340k
    return Status::OK();
492
340k
}
493
494
284k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
495
284k
    std::string op_name = print_plan_node_type(tnode.node_type);
496
284k
    _nereids_id = tnode.nereids_id;
497
284k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
498
284k
    _name = substr + "_SINK_OPERATOR";
499
284k
    return Status::OK();
500
284k
}
501
502
template <typename LocalStateType>
503
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
504
1.64M
                                                            LocalSinkStateInfo& info) {
505
1.64M
    auto local_state = LocalStateType::create_unique(this, state);
506
1.64M
    RETURN_IF_ERROR(local_state->init(state, info));
507
1.64M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
1.64M
    return Status::OK();
509
1.64M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
113k
                                                            LocalSinkStateInfo& info) {
505
113k
    auto local_state = LocalStateType::create_unique(this, state);
506
113k
    RETURN_IF_ERROR(local_state->init(state, info));
507
113k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
113k
    return Status::OK();
509
113k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
356k
                                                            LocalSinkStateInfo& info) {
505
356k
    auto local_state = LocalStateType::create_unique(this, state);
506
356k
    RETURN_IF_ERROR(local_state->init(state, info));
507
356k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
356k
    return Status::OK();
509
356k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
3
                                                            LocalSinkStateInfo& info) {
505
3
    auto local_state = LocalStateType::create_unique(this, state);
506
3
    RETURN_IF_ERROR(local_state->init(state, info));
507
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
3
    return Status::OK();
509
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
353
                                                            LocalSinkStateInfo& info) {
505
353
    auto local_state = LocalStateType::create_unique(this, state);
506
353
    RETURN_IF_ERROR(local_state->init(state, info));
507
353
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
353
    return Status::OK();
509
353
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
45.6k
                                                            LocalSinkStateInfo& info) {
505
45.6k
    auto local_state = LocalStateType::create_unique(this, state);
506
45.6k
    RETURN_IF_ERROR(local_state->init(state, info));
507
45.6k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
45.6k
    return Status::OK();
509
45.6k
}
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_25PaimonTableSinkLocalStateEE17setup_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
504
7.50k
                                                            LocalSinkStateInfo& info) {
505
7.50k
    auto local_state = LocalStateType::create_unique(this, state);
506
7.50k
    RETURN_IF_ERROR(local_state->init(state, info));
507
7.50k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
7.50k
    return Status::OK();
509
7.50k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
18
                                                            LocalSinkStateInfo& info) {
505
18
    auto local_state = LocalStateType::create_unique(this, state);
506
18
    RETURN_IF_ERROR(local_state->init(state, info));
507
18
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
18
    return Status::OK();
509
18
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
221k
                                                            LocalSinkStateInfo& info) {
505
221k
    auto local_state = LocalStateType::create_unique(this, state);
506
221k
    RETURN_IF_ERROR(local_state->init(state, info));
507
221k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
221k
    return Status::OK();
509
221k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
33
                                                            LocalSinkStateInfo& info) {
505
33
    auto local_state = LocalStateType::create_unique(this, state);
506
33
    RETURN_IF_ERROR(local_state->init(state, info));
507
33
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
33
    return Status::OK();
509
33
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
229k
                                                            LocalSinkStateInfo& info) {
505
229k
    auto local_state = LocalStateType::create_unique(this, state);
506
229k
    RETURN_IF_ERROR(local_state->init(state, info));
507
229k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
229k
    return Status::OK();
509
229k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
83.7k
                                                            LocalSinkStateInfo& info) {
505
83.7k
    auto local_state = LocalStateType::create_unique(this, state);
506
83.7k
    RETURN_IF_ERROR(local_state->init(state, info));
507
83.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
83.7k
    return Status::OK();
509
83.7k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
61.0k
                                                            LocalSinkStateInfo& info) {
505
61.0k
    auto local_state = LocalStateType::create_unique(this, state);
506
61.0k
    RETURN_IF_ERROR(local_state->init(state, info));
507
61.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
61.0k
    return Status::OK();
509
61.0k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
30
                                                            LocalSinkStateInfo& info) {
505
30
    auto local_state = LocalStateType::create_unique(this, state);
506
30
    RETURN_IF_ERROR(local_state->init(state, info));
507
30
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
30
    return Status::OK();
509
30
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
490k
                                                            LocalSinkStateInfo& info) {
505
490k
    auto local_state = LocalStateType::create_unique(this, state);
506
490k
    RETURN_IF_ERROR(local_state->init(state, info));
507
490k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
490k
    return Status::OK();
509
490k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
5.92k
                                                            LocalSinkStateInfo& info) {
505
5.92k
    auto local_state = LocalStateType::create_unique(this, state);
506
5.92k
    RETURN_IF_ERROR(local_state->init(state, info));
507
5.92k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
5.92k
    return Status::OK();
509
5.92k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
8.45k
                                                            LocalSinkStateInfo& info) {
505
8.45k
    auto local_state = LocalStateType::create_unique(this, state);
506
8.45k
    RETURN_IF_ERROR(local_state->init(state, info));
507
8.45k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
8.45k
    return Status::OK();
509
8.45k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
1.82k
                                                            LocalSinkStateInfo& info) {
505
1.82k
    auto local_state = LocalStateType::create_unique(this, state);
506
1.82k
    RETURN_IF_ERROR(local_state->init(state, info));
507
1.82k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
1.82k
    return Status::OK();
509
1.82k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
478
                                                            LocalSinkStateInfo& info) {
505
478
    auto local_state = LocalStateType::create_unique(this, state);
506
478
    RETURN_IF_ERROR(local_state->init(state, info));
507
478
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
478
    return Status::OK();
509
478
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
4.79k
                                                            LocalSinkStateInfo& info) {
505
4.79k
    auto local_state = LocalStateType::create_unique(this, state);
506
4.79k
    RETURN_IF_ERROR(local_state->init(state, info));
507
4.79k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
4.79k
    return Status::OK();
509
4.79k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
2.59k
                                                            LocalSinkStateInfo& info) {
505
2.59k
    auto local_state = LocalStateType::create_unique(this, state);
506
2.59k
    RETURN_IF_ERROR(local_state->init(state, info));
507
2.59k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
2.59k
    return Status::OK();
509
2.59k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
2.65k
                                                            LocalSinkStateInfo& info) {
505
2.65k
    auto local_state = LocalStateType::create_unique(this, state);
506
2.65k
    RETURN_IF_ERROR(local_state->init(state, info));
507
2.65k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
2.65k
    return Status::OK();
509
2.65k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
2.55k
                                                            LocalSinkStateInfo& info) {
505
2.55k
    auto local_state = LocalStateType::create_unique(this, state);
506
2.55k
    RETURN_IF_ERROR(local_state->init(state, info));
507
2.55k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
2.55k
    return Status::OK();
509
2.55k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
1
                                                            LocalSinkStateInfo& info) {
505
1
    auto local_state = LocalStateType::create_unique(this, state);
506
1
    RETURN_IF_ERROR(local_state->init(state, info));
507
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
1
    return Status::OK();
509
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
564
                                                            LocalSinkStateInfo& info) {
505
564
    auto local_state = LocalStateType::create_unique(this, state);
506
564
    RETURN_IF_ERROR(local_state->init(state, info));
507
564
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
564
    return Status::OK();
509
564
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
14
                                                            LocalSinkStateInfo& info) {
505
14
    auto local_state = LocalStateType::create_unique(this, state);
506
14
    RETURN_IF_ERROR(local_state->init(state, info));
507
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
14
    return Status::OK();
509
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
106
                                                            LocalSinkStateInfo& info) {
505
106
    auto local_state = LocalStateType::create_unique(this, state);
506
106
    RETURN_IF_ERROR(local_state->init(state, info));
507
106
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
106
    return Status::OK();
509
106
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
169
                                                            LocalSinkStateInfo& info) {
505
169
    auto local_state = LocalStateType::create_unique(this, state);
506
169
    RETURN_IF_ERROR(local_state->init(state, info));
507
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
169
    return Status::OK();
509
169
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
504
169
                                                            LocalSinkStateInfo& info) {
505
169
    auto local_state = LocalStateType::create_unique(this, state);
506
169
    RETURN_IF_ERROR(local_state->init(state, info));
507
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
508
169
    return Status::OK();
509
169
}
510
511
template <typename LocalStateType>
512
1.32M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
0
                                 LocalExchangeSharedState>) {
515
0
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
0
                                        MultiCastSharedState>) {
518
0
        throw Exception(Status::FatalError("should not reach here!"));
519
1.32M
    } else {
520
1.32M
        auto ss = LocalStateType::SharedStateType::create_shared();
521
1.32M
        ss->id = operator_id();
522
1.32M
        for (auto& dest : dests_id()) {
523
1.31M
            ss->related_op_ids.insert(dest);
524
1.31M
        }
525
1.32M
        return ss;
526
1.32M
    }
527
1.32M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
101k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
101k
    } else {
520
101k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
101k
        ss->id = operator_id();
522
101k
        for (auto& dest : dests_id()) {
523
101k
            ss->related_op_ids.insert(dest);
524
101k
        }
525
101k
        return ss;
526
101k
    }
527
101k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
357k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
357k
    } else {
520
357k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
357k
        ss->id = operator_id();
522
357k
        for (auto& dest : dests_id()) {
523
356k
            ss->related_op_ids.insert(dest);
524
356k
        }
525
357k
        return ss;
526
357k
    }
527
357k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
3
    } else {
520
3
        auto ss = LocalStateType::SharedStateType::create_shared();
521
3
        ss->id = operator_id();
522
3
        for (auto& dest : dests_id()) {
523
3
            ss->related_op_ids.insert(dest);
524
3
        }
525
3
        return ss;
526
3
    }
527
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
353
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
353
    } else {
520
353
        auto ss = LocalStateType::SharedStateType::create_shared();
521
353
        ss->id = operator_id();
522
353
        for (auto& dest : dests_id()) {
523
353
            ss->related_op_ids.insert(dest);
524
353
        }
525
353
        return ss;
526
353
    }
527
353
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
45.7k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
45.7k
    } else {
520
45.7k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
45.7k
        ss->id = operator_id();
522
45.7k
        for (auto& dest : dests_id()) {
523
45.4k
            ss->related_op_ids.insert(dest);
524
45.4k
        }
525
45.7k
        return ss;
526
45.7k
    }
527
45.7k
}
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_25PaimonTableSinkLocalStateEE19create_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
512
7.53k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
7.53k
    } else {
520
7.53k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
7.53k
        ss->id = operator_id();
522
7.53k
        for (auto& dest : dests_id()) {
523
7.53k
            ss->related_op_ids.insert(dest);
524
7.53k
        }
525
7.53k
        return ss;
526
7.53k
    }
527
7.53k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
18
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
18
    } else {
520
18
        auto ss = LocalStateType::SharedStateType::create_shared();
521
18
        ss->id = operator_id();
522
18
        for (auto& dest : dests_id()) {
523
18
            ss->related_op_ids.insert(dest);
524
18
        }
525
18
        return ss;
526
18
    }
527
18
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
222k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
222k
    } else {
520
222k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
222k
        ss->id = operator_id();
522
222k
        for (auto& dest : dests_id()) {
523
222k
            ss->related_op_ids.insert(dest);
524
222k
        }
525
222k
        return ss;
526
222k
    }
527
222k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
35
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
35
    } else {
520
35
        auto ss = LocalStateType::SharedStateType::create_shared();
521
35
        ss->id = operator_id();
522
35
        for (auto& dest : dests_id()) {
523
35
            ss->related_op_ids.insert(dest);
524
35
        }
525
35
        return ss;
526
35
    }
527
35
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
83.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
83.8k
    } else {
520
83.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
83.8k
        ss->id = operator_id();
522
83.8k
        for (auto& dest : dests_id()) {
523
83.8k
            ss->related_op_ids.insert(dest);
524
83.8k
        }
525
83.8k
        return ss;
526
83.8k
    }
527
83.8k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
29
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
29
    } else {
520
29
        auto ss = LocalStateType::SharedStateType::create_shared();
521
29
        ss->id = operator_id();
522
29
        for (auto& dest : dests_id()) {
523
29
            ss->related_op_ids.insert(dest);
524
29
        }
525
29
        return ss;
526
29
    }
527
29
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
492k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
492k
    } else {
520
492k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
492k
        ss->id = operator_id();
522
492k
        for (auto& dest : dests_id()) {
523
486k
            ss->related_op_ids.insert(dest);
524
486k
        }
525
492k
        return ss;
526
492k
    }
527
492k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
5.93k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
5.93k
    } else {
520
5.93k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
5.93k
        ss->id = operator_id();
522
5.93k
        for (auto& dest : dests_id()) {
523
5.92k
            ss->related_op_ids.insert(dest);
524
5.92k
        }
525
5.93k
        return ss;
526
5.93k
    }
527
5.93k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
581
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
581
    } else {
520
581
        auto ss = LocalStateType::SharedStateType::create_shared();
521
581
        ss->id = operator_id();
522
581
        for (auto& dest : dests_id()) {
523
580
            ss->related_op_ids.insert(dest);
524
580
        }
525
581
        return ss;
526
581
    }
527
581
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
512
2.65k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
2.65k
    } else {
520
2.65k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
2.65k
        ss->id = operator_id();
522
2.65k
        for (auto& dest : dests_id()) {
523
2.65k
            ss->related_op_ids.insert(dest);
524
2.65k
        }
525
2.65k
        return ss;
526
2.65k
    }
527
2.65k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
512
2.54k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
2.54k
    } else {
520
2.54k
        auto ss = LocalStateType::SharedStateType::create_shared();
521
2.54k
        ss->id = operator_id();
522
2.55k
        for (auto& dest : dests_id()) {
523
2.55k
            ss->related_op_ids.insert(dest);
524
2.55k
        }
525
2.54k
        return ss;
526
2.54k
    }
527
2.54k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
567
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
567
    } else {
520
567
        auto ss = LocalStateType::SharedStateType::create_shared();
521
567
        ss->id = operator_id();
522
567
        for (auto& dest : dests_id()) {
523
557
            ss->related_op_ids.insert(dest);
524
557
        }
525
567
        return ss;
526
567
    }
527
567
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
512
106
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
513
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
514
                                 LocalExchangeSharedState>) {
515
        return nullptr;
516
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
517
                                        MultiCastSharedState>) {
518
        throw Exception(Status::FatalError("should not reach here!"));
519
106
    } else {
520
106
        auto ss = LocalStateType::SharedStateType::create_shared();
521
106
        ss->id = operator_id();
522
106
        for (auto& dest : dests_id()) {
523
106
            ss->related_op_ids.insert(dest);
524
106
        }
525
106
        return ss;
526
106
    }
527
106
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
528
529
template <typename LocalStateType>
530
1.94M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
1.94M
    auto local_state = LocalStateType::create_unique(state, this);
532
1.94M
    RETURN_IF_ERROR(local_state->init(state, info));
533
1.94M
    state->emplace_local_state(operator_id(), std::move(local_state));
534
1.94M
    return Status::OK();
535
1.94M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
65.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
65.6k
    auto local_state = LocalStateType::create_unique(state, this);
532
65.6k
    RETURN_IF_ERROR(local_state->init(state, info));
533
65.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
65.6k
    return Status::OK();
535
65.6k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
238k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
238k
    auto local_state = LocalStateType::create_unique(state, this);
532
238k
    RETURN_IF_ERROR(local_state->init(state, info));
533
238k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
238k
    return Status::OK();
535
238k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
137
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
137
    auto local_state = LocalStateType::create_unique(state, this);
532
137
    RETURN_IF_ERROR(local_state->init(state, info));
533
137
    state->emplace_local_state(operator_id(), std::move(local_state));
534
137
    return Status::OK();
535
137
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
532
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
533
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
3.08k
    return Status::OK();
535
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
7.51k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
7.51k
    auto local_state = LocalStateType::create_unique(state, this);
532
7.51k
    RETURN_IF_ERROR(local_state->init(state, info));
533
7.51k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
7.51k
    return Status::OK();
535
7.51k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
7.41k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
7.41k
    auto local_state = LocalStateType::create_unique(state, this);
532
7.41k
    RETURN_IF_ERROR(local_state->init(state, info));
533
7.41k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
7.41k
    return Status::OK();
535
7.41k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
26
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
26
    auto local_state = LocalStateType::create_unique(state, this);
532
26
    RETURN_IF_ERROR(local_state->init(state, info));
533
26
    state->emplace_local_state(operator_id(), std::move(local_state));
534
26
    return Status::OK();
535
26
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
213k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
213k
    auto local_state = LocalStateType::create_unique(state, this);
532
213k
    RETURN_IF_ERROR(local_state->init(state, info));
533
213k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
213k
    return Status::OK();
535
213k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
83.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
83.7k
    auto local_state = LocalStateType::create_unique(state, this);
532
83.7k
    RETURN_IF_ERROR(local_state->init(state, info));
533
83.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
83.7k
    return Status::OK();
535
83.7k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
61.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
61.2k
    auto local_state = LocalStateType::create_unique(state, this);
532
61.2k
    RETURN_IF_ERROR(local_state->init(state, info));
533
61.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
61.2k
    return Status::OK();
535
61.2k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
20
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
20
    auto local_state = LocalStateType::create_unique(state, this);
532
20
    RETURN_IF_ERROR(local_state->init(state, info));
533
20
    state->emplace_local_state(operator_id(), std::move(local_state));
534
20
    return Status::OK();
535
20
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
4.06k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
4.06k
    auto local_state = LocalStateType::create_unique(state, this);
532
4.06k
    RETURN_IF_ERROR(local_state->init(state, info));
533
4.06k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
4.06k
    return Status::OK();
535
4.06k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
271k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
271k
    auto local_state = LocalStateType::create_unique(state, this);
532
271k
    RETURN_IF_ERROR(local_state->init(state, info));
533
271k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
271k
    return Status::OK();
535
271k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
1.40k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
1.40k
    auto local_state = LocalStateType::create_unique(state, this);
532
1.40k
    RETURN_IF_ERROR(local_state->init(state, info));
533
1.40k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
1.40k
    return Status::OK();
535
1.40k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
5.91k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
5.91k
    auto local_state = LocalStateType::create_unique(state, this);
532
5.91k
    RETURN_IF_ERROR(local_state->init(state, info));
533
5.91k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
5.91k
    return Status::OK();
535
5.91k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
27
    auto local_state = LocalStateType::create_unique(state, this);
532
27
    RETURN_IF_ERROR(local_state->init(state, info));
533
27
    state->emplace_local_state(operator_id(), std::move(local_state));
534
27
    return Status::OK();
535
27
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
532
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
533
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
1.60k
    return Status::OK();
535
1.60k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
54.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
54.4k
    auto local_state = LocalStateType::create_unique(state, this);
532
54.4k
    RETURN_IF_ERROR(local_state->init(state, info));
533
54.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
54.4k
    return Status::OK();
535
54.4k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
4.45k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
4.45k
    auto local_state = LocalStateType::create_unique(state, this);
532
4.45k
    RETURN_IF_ERROR(local_state->init(state, info));
533
4.45k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
4.45k
    return Status::OK();
535
4.45k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
478
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
478
    auto local_state = LocalStateType::create_unique(state, this);
532
478
    RETURN_IF_ERROR(local_state->init(state, info));
533
478
    state->emplace_local_state(operator_id(), std::move(local_state));
534
478
    return Status::OK();
535
478
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
2.67k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
2.67k
    auto local_state = LocalStateType::create_unique(state, this);
532
2.67k
    RETURN_IF_ERROR(local_state->init(state, info));
533
2.67k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
2.67k
    return Status::OK();
535
2.67k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
2.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
2.57k
    auto local_state = LocalStateType::create_unique(state, this);
532
2.57k
    RETURN_IF_ERROR(local_state->init(state, info));
533
2.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
2.57k
    return Status::OK();
535
2.57k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
326
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
326
    auto local_state = LocalStateType::create_unique(state, this);
532
326
    RETURN_IF_ERROR(local_state->init(state, info));
533
326
    state->emplace_local_state(operator_id(), std::move(local_state));
534
326
    return Status::OK();
535
326
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
532
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
533
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
1.60k
    return Status::OK();
535
1.60k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
10.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
10.4k
    auto local_state = LocalStateType::create_unique(state, this);
532
10.4k
    RETURN_IF_ERROR(local_state->init(state, info));
533
10.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
10.4k
    return Status::OK();
535
10.4k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
602k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
602k
    auto local_state = LocalStateType::create_unique(state, this);
532
602k
    RETURN_IF_ERROR(local_state->init(state, info));
533
602k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
602k
    return Status::OK();
535
602k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
14
    auto local_state = LocalStateType::create_unique(state, this);
532
14
    RETURN_IF_ERROR(local_state->init(state, info));
533
14
    state->emplace_local_state(operator_id(), std::move(local_state));
534
14
    return Status::OK();
535
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
169
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
169
    auto local_state = LocalStateType::create_unique(state, this);
532
169
    RETURN_IF_ERROR(local_state->init(state, info));
533
169
    state->emplace_local_state(operator_id(), std::move(local_state));
534
169
    return Status::OK();
535
169
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
2.20k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
2.20k
    auto local_state = LocalStateType::create_unique(state, this);
532
2.20k
    RETURN_IF_ERROR(local_state->init(state, info));
533
2.20k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
2.20k
    return Status::OK();
535
2.20k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
781
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
781
    auto local_state = LocalStateType::create_unique(state, this);
532
781
    RETURN_IF_ERROR(local_state->init(state, info));
533
781
    state->emplace_local_state(operator_id(), std::move(local_state));
534
781
    return Status::OK();
535
781
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
962
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
962
    auto local_state = LocalStateType::create_unique(state, this);
532
962
    RETURN_IF_ERROR(local_state->init(state, info));
533
962
    state->emplace_local_state(operator_id(), std::move(local_state));
534
962
    return Status::OK();
535
962
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
5.64k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
5.64k
    auto local_state = LocalStateType::create_unique(state, this);
532
5.64k
    RETURN_IF_ERROR(local_state->init(state, info));
533
5.64k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
5.64k
    return Status::OK();
535
5.64k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
530
287k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
531
287k
    auto local_state = LocalStateType::create_unique(state, this);
532
287k
    RETURN_IF_ERROR(local_state->init(state, info));
533
287k
    state->emplace_local_state(operator_id(), std::move(local_state));
534
287k
    return Status::OK();
535
287k
}
536
537
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
538
                                                         RuntimeState* state)
539
1.63M
        : _parent(parent), _state(state) {}
540
541
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
542
1.93M
        : _num_rows_returned(0),
543
1.93M
          _rows_returned_counter(nullptr),
544
1.93M
          _parent(parent),
545
1.93M
          _state(state),
546
1.93M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
547
548
template <typename SharedStateArg>
549
1.94M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
1.94M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
1.94M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
1.94M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
1.94M
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
1.94M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
1.94M
    _operator_profile->add_child(_common_profile.get(), true);
558
1.94M
    _operator_profile->add_child(_custom_profile.get(), true);
559
1.94M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
1.94M
    if constexpr (!is_fake_shared) {
561
1.11M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
671k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
671k
                                    .first.get()
564
671k
                                    ->template cast<SharedStateArg>();
565
566
671k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
671k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
671k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
671k
        } else if (info.shared_state) {
570
375k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
0
                DCHECK(false);
572
0
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
375k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
375k
            _dependency = _shared_state->create_source_dependency(
577
375k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
375k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
375k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
375k
        } else {
581
72.3k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
9.42k
                DCHECK(false);
583
9.42k
            }
584
72.3k
        }
585
1.11M
    }
586
587
1.94M
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
1.94M
    _rows_returned_counter =
592
1.94M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
1.94M
    _blocks_returned_counter =
594
1.94M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
1.94M
    _output_block_bytes_counter =
596
1.94M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
1.94M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
1.94M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
1.94M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
1.94M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
1.94M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
1.94M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
1.94M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
1.94M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
1.94M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
1.94M
    _memory_used_counter =
607
1.94M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
1.94M
    _common_profile->add_info_string("IsColocate",
609
1.94M
                                     std::to_string(_parent->is_colocated_operator()));
610
1.94M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
1.94M
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
1.94M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
1.94M
    return Status::OK();
614
1.94M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
65.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
65.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
65.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
65.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
65.6k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
65.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
65.6k
    _operator_profile->add_child(_common_profile.get(), true);
558
65.6k
    _operator_profile->add_child(_custom_profile.get(), true);
559
65.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
65.6k
    if constexpr (!is_fake_shared) {
561
65.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
12.3k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
12.3k
                                    .first.get()
564
12.3k
                                    ->template cast<SharedStateArg>();
565
566
12.3k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
12.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
12.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
53.3k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
52.6k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
52.6k
            _dependency = _shared_state->create_source_dependency(
577
52.6k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
52.6k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
52.6k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
52.6k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
659
        }
585
65.6k
    }
586
587
65.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
65.6k
    _rows_returned_counter =
592
65.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
65.6k
    _blocks_returned_counter =
594
65.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
65.6k
    _output_block_bytes_counter =
596
65.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
65.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
65.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
65.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
65.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
65.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
65.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
65.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
65.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
65.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
65.6k
    _memory_used_counter =
607
65.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
65.6k
    _common_profile->add_info_string("IsColocate",
609
65.6k
                                     std::to_string(_parent->is_colocated_operator()));
610
65.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
65.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
65.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
65.6k
    return Status::OK();
614
65.6k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
1
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
1
    _operator_profile->add_child(_common_profile.get(), true);
558
1
    _operator_profile->add_child(_custom_profile.get(), true);
559
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
1
    if constexpr (!is_fake_shared) {
561
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
1
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
1
            _dependency = _shared_state->create_source_dependency(
577
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
1
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
1
    }
586
587
1
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
1
    _rows_returned_counter =
592
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
1
    _blocks_returned_counter =
594
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
1
    _output_block_bytes_counter =
596
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
1
    _memory_used_counter =
607
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
1
    _common_profile->add_info_string("IsColocate",
609
1
                                     std::to_string(_parent->is_colocated_operator()));
610
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
1
    return Status::OK();
614
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
222k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
222k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
222k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
222k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
222k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
222k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
222k
    _operator_profile->add_child(_common_profile.get(), true);
558
222k
    _operator_profile->add_child(_custom_profile.get(), true);
559
222k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
222k
    if constexpr (!is_fake_shared) {
561
222k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
222k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
212k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
212k
            _dependency = _shared_state->create_source_dependency(
577
212k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
212k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
212k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
212k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
10.4k
        }
585
222k
    }
586
587
222k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
222k
    _rows_returned_counter =
592
222k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
222k
    _blocks_returned_counter =
594
222k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
222k
    _output_block_bytes_counter =
596
222k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
222k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
222k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
222k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
222k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
222k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
222k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
222k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
222k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
222k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
222k
    _memory_used_counter =
607
222k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
222k
    _common_profile->add_info_string("IsColocate",
609
222k
                                     std::to_string(_parent->is_colocated_operator()));
610
222k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
222k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
222k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
222k
    return Status::OK();
614
222k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
26
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
26
    _operator_profile->add_child(_common_profile.get(), true);
558
26
    _operator_profile->add_child(_custom_profile.get(), true);
559
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
26
    if constexpr (!is_fake_shared) {
561
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
26
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
26
            _dependency = _shared_state->create_source_dependency(
577
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
26
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
26
    }
586
587
26
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
26
    _rows_returned_counter =
592
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
26
    _blocks_returned_counter =
594
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
26
    _output_block_bytes_counter =
596
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
26
    _memory_used_counter =
607
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
26
    _common_profile->add_info_string("IsColocate",
609
26
                                     std::to_string(_parent->is_colocated_operator()));
610
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
26
    return Status::OK();
614
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
5.94k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
5.94k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
5.94k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
5.94k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
5.94k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
5.94k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
5.94k
    _operator_profile->add_child(_common_profile.get(), true);
558
5.94k
    _operator_profile->add_child(_custom_profile.get(), true);
559
5.94k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
5.94k
    if constexpr (!is_fake_shared) {
561
5.94k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
5.94k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
5.87k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
5.87k
            _dependency = _shared_state->create_source_dependency(
577
5.87k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
5.87k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
5.87k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
5.87k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
69
        }
585
5.94k
    }
586
587
5.94k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
5.94k
    _rows_returned_counter =
592
5.94k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
5.94k
    _blocks_returned_counter =
594
5.94k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
5.94k
    _output_block_bytes_counter =
596
5.94k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
5.94k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
5.94k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
5.94k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
5.94k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
5.94k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
5.94k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
5.94k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
5.94k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
5.94k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
5.94k
    _memory_used_counter =
607
5.94k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
5.94k
    _common_profile->add_info_string("IsColocate",
609
5.94k
                                     std::to_string(_parent->is_colocated_operator()));
610
5.94k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
5.94k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
5.94k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
5.94k
    return Status::OK();
614
5.94k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
7.53k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
7.53k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
7.53k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
7.53k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
7.53k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
7.53k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
7.53k
    _operator_profile->add_child(_common_profile.get(), true);
558
7.53k
    _operator_profile->add_child(_custom_profile.get(), true);
559
7.53k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
7.53k
    if constexpr (!is_fake_shared) {
561
7.53k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
7.53k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
7.49k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
7.49k
            _dependency = _shared_state->create_source_dependency(
577
7.49k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
7.49k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
7.49k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
7.49k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
39
        }
585
7.53k
    }
586
587
7.53k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
7.53k
    _rows_returned_counter =
592
7.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
7.53k
    _blocks_returned_counter =
594
7.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
7.53k
    _output_block_bytes_counter =
596
7.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
7.53k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
7.53k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
7.53k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
7.53k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
7.53k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
7.53k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
7.53k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
7.53k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
7.53k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
7.53k
    _memory_used_counter =
607
7.53k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
7.53k
    _common_profile->add_info_string("IsColocate",
609
7.53k
                                     std::to_string(_parent->is_colocated_operator()));
610
7.53k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
7.53k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
7.53k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
7.53k
    return Status::OK();
614
7.53k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
83.9k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
83.9k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
83.9k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
83.9k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
83.9k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
83.9k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
83.9k
    _operator_profile->add_child(_common_profile.get(), true);
558
83.9k
    _operator_profile->add_child(_custom_profile.get(), true);
559
83.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
83.9k
    if constexpr (!is_fake_shared) {
561
83.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
83.9k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
82.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
82.8k
            _dependency = _shared_state->create_source_dependency(
577
82.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
82.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
82.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
82.8k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
1.13k
        }
585
83.9k
    }
586
587
83.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
83.9k
    _rows_returned_counter =
592
83.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
83.9k
    _blocks_returned_counter =
594
83.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
83.9k
    _output_block_bytes_counter =
596
83.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
83.9k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
83.9k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
83.9k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
83.9k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
83.9k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
83.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
83.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
83.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
83.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
83.9k
    _memory_used_counter =
607
83.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
83.9k
    _common_profile->add_info_string("IsColocate",
609
83.9k
                                     std::to_string(_parent->is_colocated_operator()));
610
83.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
83.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
83.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
83.9k
    return Status::OK();
614
83.9k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
61.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
61.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
61.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
61.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
61.2k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
61.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
61.2k
    _operator_profile->add_child(_common_profile.get(), true);
558
61.2k
    _operator_profile->add_child(_custom_profile.get(), true);
559
61.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
61.2k
    if constexpr (!is_fake_shared) {
561
61.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
61.2k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
61.2k
                                    .first.get()
564
61.2k
                                    ->template cast<SharedStateArg>();
565
566
61.2k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
61.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
61.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
18.4E
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
0
            _dependency = _shared_state->create_source_dependency(
577
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
18.4E
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
18.4E
        }
585
61.2k
    }
586
587
61.2k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
61.2k
    _rows_returned_counter =
592
61.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
61.2k
    _blocks_returned_counter =
594
61.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
61.2k
    _output_block_bytes_counter =
596
61.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
61.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
61.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
61.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
61.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
61.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
61.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
61.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
61.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
61.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
61.2k
    _memory_used_counter =
607
61.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
61.2k
    _common_profile->add_info_string("IsColocate",
609
61.2k
                                     std::to_string(_parent->is_colocated_operator()));
610
61.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
61.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
61.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
61.2k
    return Status::OK();
614
61.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
20
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
20
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
20
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
20
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
20
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
20
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
20
    _operator_profile->add_child(_common_profile.get(), true);
558
20
    _operator_profile->add_child(_custom_profile.get(), true);
559
20
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
20
    if constexpr (!is_fake_shared) {
561
20
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
20
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
20
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
20
            _dependency = _shared_state->create_source_dependency(
577
20
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
20
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
20
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
20
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
20
    }
586
587
20
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
20
    _rows_returned_counter =
592
20
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
20
    _blocks_returned_counter =
594
20
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
20
    _output_block_bytes_counter =
596
20
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
20
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
20
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
20
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
20
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
20
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
20
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
20
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
20
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
20
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
20
    _memory_used_counter =
607
20
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
20
    _common_profile->add_info_string("IsColocate",
609
20
                                     std::to_string(_parent->is_colocated_operator()));
610
20
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
20
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
20
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
20
    return Status::OK();
614
20
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
827k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
827k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
827k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
827k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
827k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
827k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
827k
    _operator_profile->add_child(_common_profile.get(), true);
558
827k
    _operator_profile->add_child(_custom_profile.get(), true);
559
827k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
    if constexpr (!is_fake_shared) {
561
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
                                    .first.get()
564
                                    ->template cast<SharedStateArg>();
565
566
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
            _dependency = _shared_state->create_source_dependency(
577
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
        }
585
    }
586
587
827k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
827k
    _rows_returned_counter =
592
827k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
827k
    _blocks_returned_counter =
594
827k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
827k
    _output_block_bytes_counter =
596
827k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
827k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
827k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
827k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
827k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
827k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
827k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
827k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
827k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
827k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
827k
    _memory_used_counter =
607
827k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
827k
    _common_profile->add_info_string("IsColocate",
609
827k
                                     std::to_string(_parent->is_colocated_operator()));
610
827k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
827k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
827k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
827k
    return Status::OK();
614
827k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
54.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
54.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
54.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
54.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
54.4k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
54.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
54.4k
    _operator_profile->add_child(_common_profile.get(), true);
558
54.4k
    _operator_profile->add_child(_custom_profile.get(), true);
559
54.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
54.4k
    if constexpr (!is_fake_shared) {
561
54.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
54.4k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
3.81k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
3.81k
            _dependency = _shared_state->create_source_dependency(
577
3.81k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
3.81k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
3.81k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
50.5k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
50.5k
        }
585
54.4k
    }
586
587
54.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
54.4k
    _rows_returned_counter =
592
54.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
54.4k
    _blocks_returned_counter =
594
54.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
54.4k
    _output_block_bytes_counter =
596
54.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
54.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
54.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
54.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
54.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
54.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
54.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
54.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
54.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
54.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
54.4k
    _memory_used_counter =
607
54.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
54.4k
    _common_profile->add_info_string("IsColocate",
609
54.4k
                                     std::to_string(_parent->is_colocated_operator()));
610
54.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
54.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
54.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
54.4k
    return Status::OK();
614
54.4k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
26
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
26
    _operator_profile->add_child(_common_profile.get(), true);
558
26
    _operator_profile->add_child(_custom_profile.get(), true);
559
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
26
    if constexpr (!is_fake_shared) {
561
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
26
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
26
            _dependency = _shared_state->create_source_dependency(
577
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
26
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
26
    }
586
587
26
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
26
    _rows_returned_counter =
592
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
26
    _blocks_returned_counter =
594
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
26
    _output_block_bytes_counter =
596
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
26
    _memory_used_counter =
607
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
26
    _common_profile->add_info_string("IsColocate",
609
26
                                     std::to_string(_parent->is_colocated_operator()));
610
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
26
    return Status::OK();
614
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
4.47k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
4.47k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
4.47k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
4.47k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
4.47k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
4.47k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
4.47k
    _operator_profile->add_child(_common_profile.get(), true);
558
4.47k
    _operator_profile->add_child(_custom_profile.get(), true);
559
4.47k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
4.47k
    if constexpr (!is_fake_shared) {
561
4.47k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
4.47k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
4.43k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
4.43k
            _dependency = _shared_state->create_source_dependency(
577
4.43k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
4.43k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
4.43k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
4.43k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
39
        }
585
4.47k
    }
586
587
4.47k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
4.47k
    _rows_returned_counter =
592
4.47k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
4.47k
    _blocks_returned_counter =
594
4.47k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
4.47k
    _output_block_bytes_counter =
596
4.47k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
4.47k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
4.47k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
4.47k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
4.47k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
4.47k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
4.47k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
4.47k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
4.47k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
4.47k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
4.47k
    _memory_used_counter =
607
4.47k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
4.47k
    _common_profile->add_info_string("IsColocate",
609
4.47k
                                     std::to_string(_parent->is_colocated_operator()));
610
4.47k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
4.47k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
4.47k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
4.47k
    return Status::OK();
614
4.47k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
580
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
580
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
580
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
580
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
580
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
580
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
580
    _operator_profile->add_child(_common_profile.get(), true);
558
580
    _operator_profile->add_child(_custom_profile.get(), true);
559
580
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
580
    if constexpr (!is_fake_shared) {
561
580
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
580
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
579
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
579
            _dependency = _shared_state->create_source_dependency(
577
579
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
579
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
579
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
579
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
1
        }
585
580
    }
586
587
580
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
580
    _rows_returned_counter =
592
580
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
580
    _blocks_returned_counter =
594
580
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
580
    _output_block_bytes_counter =
596
580
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
580
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
580
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
580
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
580
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
580
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
580
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
580
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
580
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
580
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
580
    _memory_used_counter =
607
580
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
580
    _common_profile->add_info_string("IsColocate",
609
580
                                     std::to_string(_parent->is_colocated_operator()));
610
580
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
580
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
580
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
580
    return Status::OK();
614
580
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
5.26k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
5.26k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
5.26k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
5.26k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
5.26k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
5.26k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
5.26k
    _operator_profile->add_child(_common_profile.get(), true);
558
5.26k
    _operator_profile->add_child(_custom_profile.get(), true);
559
5.26k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
5.26k
    if constexpr (!is_fake_shared) {
561
5.26k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
5.26k
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
5.22k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
5.22k
            _dependency = _shared_state->create_source_dependency(
577
5.22k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
5.22k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
5.22k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
5.22k
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
41
        }
585
5.26k
    }
586
587
5.26k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
5.26k
    _rows_returned_counter =
592
5.26k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
5.26k
    _blocks_returned_counter =
594
5.26k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
5.26k
    _output_block_bytes_counter =
596
5.26k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
5.26k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
5.26k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
5.26k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
5.26k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
5.26k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
5.26k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
5.26k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
5.26k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
5.26k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
5.26k
    _memory_used_counter =
607
5.26k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
5.26k
    _common_profile->add_info_string("IsColocate",
609
5.26k
                                     std::to_string(_parent->is_colocated_operator()));
610
5.26k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
5.26k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
5.26k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
5.26k
    return Status::OK();
614
5.26k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
606k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
606k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
606k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
606k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
606k
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
606k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
606k
    _operator_profile->add_child(_common_profile.get(), true);
558
606k
    _operator_profile->add_child(_custom_profile.get(), true);
559
606k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
606k
    if constexpr (!is_fake_shared) {
561
606k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
597k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
597k
                                    .first.get()
564
597k
                                    ->template cast<SharedStateArg>();
565
566
597k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
597k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
597k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
597k
        } else if (info.shared_state) {
570
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
0
                DCHECK(false);
572
0
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
0
            _dependency = _shared_state->create_source_dependency(
577
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
9.42k
        } else {
581
9.42k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
9.42k
                DCHECK(false);
583
9.42k
            }
584
9.42k
        }
585
606k
    }
586
587
606k
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
606k
    _rows_returned_counter =
592
606k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
606k
    _blocks_returned_counter =
594
606k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
606k
    _output_block_bytes_counter =
596
606k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
606k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
606k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
606k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
606k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
606k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
606k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
606k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
606k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
606k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
606k
    _memory_used_counter =
607
606k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
606k
    _common_profile->add_info_string("IsColocate",
609
606k
                                     std::to_string(_parent->is_colocated_operator()));
610
606k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
606k
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
606k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
606k
    return Status::OK();
614
606k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
549
169
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
550
169
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
551
169
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
552
169
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
553
169
    _operator_profile->set_metadata(_parent->node_id());
554
    // indent is false so that source operator will have same
555
    // indentation_level with its parent operator.
556
169
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
557
169
    _operator_profile->add_child(_common_profile.get(), true);
558
169
    _operator_profile->add_child(_custom_profile.get(), true);
559
169
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
560
169
    if constexpr (!is_fake_shared) {
561
169
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
562
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
563
0
                                    .first.get()
564
0
                                    ->template cast<SharedStateArg>();
565
566
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
567
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
568
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
569
169
        } else if (info.shared_state) {
570
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
571
                DCHECK(false);
572
            }
573
            // For UnionSourceOperator without children, there is no shared state.
574
169
            _shared_state = info.shared_state->template cast<SharedStateArg>();
575
576
169
            _dependency = _shared_state->create_source_dependency(
577
169
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
578
169
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
579
169
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
580
169
        } else {
581
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
582
                DCHECK(false);
583
            }
584
0
        }
585
169
    }
586
587
169
    if (must_set_shared_state() && _shared_state == nullptr) {
588
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
589
0
    }
590
591
169
    _rows_returned_counter =
592
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
593
169
    _blocks_returned_counter =
594
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
595
169
    _output_block_bytes_counter =
596
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
597
169
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
598
169
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
599
169
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
600
169
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
601
169
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
602
169
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
603
169
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
604
169
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
605
169
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
606
169
    _memory_used_counter =
607
169
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
608
169
    _common_profile->add_info_string("IsColocate",
609
169
                                     std::to_string(_parent->is_colocated_operator()));
610
169
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
611
169
    _common_profile->add_info_string("FollowedByShuffledOperator",
612
169
                                     std::to_string(_parent->followed_by_shuffled_operator()));
613
169
    return Status::OK();
614
169
}
615
616
template <typename SharedStateArg>
617
1.95M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
1.95M
    _conjuncts.resize(_parent->_conjuncts.size());
619
2.25M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
299k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
299k
    }
622
1.95M
    if (_parent->has_projection()) {
623
369k
        const auto& projection = *_parent->_projection;
624
369k
        _projections.resize(projection.projections.size());
625
2.29M
        for (size_t i = 0; i < _projections.size(); i++) {
626
1.92M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
1.92M
        }
628
369k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
385k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
16.5k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
215k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
198k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
198k
                        state, _intermediate_projections[i][j]));
634
198k
            }
635
16.5k
        }
636
369k
    }
637
1.95M
    return Status::OK();
638
1.95M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
65.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
65.8k
    _conjuncts.resize(_parent->_conjuncts.size());
619
67.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
1.36k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
1.36k
    }
622
65.8k
    if (_parent->has_projection()) {
623
65.7k
        const auto& projection = *_parent->_projection;
624
65.7k
        _projections.resize(projection.projections.size());
625
347k
        for (size_t i = 0; i < _projections.size(); i++) {
626
282k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
282k
        }
628
65.7k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
72.7k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
6.99k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
155k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
148k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
148k
                        state, _intermediate_projections[i][j]));
634
148k
            }
635
6.99k
        }
636
65.7k
    }
637
65.8k
    return Status::OK();
638
65.8k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
3
    _conjuncts.resize(_parent->_conjuncts.size());
619
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
3
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
3
    return Status::OK();
638
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
224k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
224k
    _conjuncts.resize(_parent->_conjuncts.size());
619
224k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
224k
    if (_parent->has_projection()) {
623
80
        const auto& projection = *_parent->_projection;
624
80
        _projections.resize(projection.projections.size());
625
405
        for (size_t i = 0; i < _projections.size(); i++) {
626
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
325
        }
628
80
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
80
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
80
    }
637
224k
    return Status::OK();
638
224k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
26
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
26
    _conjuncts.resize(_parent->_conjuncts.size());
619
26
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
26
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
26
    return Status::OK();
638
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
5.95k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
5.95k
    _conjuncts.resize(_parent->_conjuncts.size());
619
6.08k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
134
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
134
    }
622
5.95k
    if (_parent->has_projection()) {
623
5.95k
        const auto& projection = *_parent->_projection;
624
5.95k
        _projections.resize(projection.projections.size());
625
24.3k
        for (size_t i = 0; i < _projections.size(); i++) {
626
18.3k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
18.3k
        }
628
5.95k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
5.99k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
36
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
256
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
220
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
220
                        state, _intermediate_projections[i][j]));
634
220
            }
635
36
        }
636
5.95k
    }
637
5.95k
    return Status::OK();
638
5.95k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
7.54k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
7.54k
    _conjuncts.resize(_parent->_conjuncts.size());
619
8.59k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
1.05k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
1.05k
    }
622
7.54k
    if (_parent->has_projection()) {
623
3.99k
        const auto& projection = *_parent->_projection;
624
3.99k
        _projections.resize(projection.projections.size());
625
17.1k
        for (size_t i = 0; i < _projections.size(); i++) {
626
13.1k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
13.1k
        }
628
3.99k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
4.07k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
87
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
650
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
563
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
563
                        state, _intermediate_projections[i][j]));
634
563
            }
635
87
        }
636
3.99k
    }
637
7.54k
    return Status::OK();
638
7.54k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
84.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
84.0k
    _conjuncts.resize(_parent->_conjuncts.size());
619
85.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
1.37k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
1.37k
    }
622
84.0k
    if (_parent->has_projection()) {
623
28.4k
        const auto& projection = *_parent->_projection;
624
28.4k
        _projections.resize(projection.projections.size());
625
267k
        for (size_t i = 0; i < _projections.size(); i++) {
626
238k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
238k
        }
628
28.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
28.6k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
168
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
1.01k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
844
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
844
                        state, _intermediate_projections[i][j]));
634
844
            }
635
168
        }
636
28.4k
    }
637
84.0k
    return Status::OK();
638
84.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
61.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
61.2k
    _conjuncts.resize(_parent->_conjuncts.size());
619
61.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
42
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
42
    }
622
61.2k
    if (_parent->has_projection()) {
623
238
        const auto& projection = *_parent->_projection;
624
238
        _projections.resize(projection.projections.size());
625
1.08k
        for (size_t i = 0; i < _projections.size(); i++) {
626
851
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
851
        }
628
238
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
239
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
1
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
10
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
10
                        state, _intermediate_projections[i][j]));
634
10
            }
635
1
        }
636
238
    }
637
61.2k
    return Status::OK();
638
61.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
24
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
24
    _conjuncts.resize(_parent->_conjuncts.size());
619
24
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
24
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
24
    return Status::OK();
638
24
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
832k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
832k
    _conjuncts.resize(_parent->_conjuncts.size());
619
1.12M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
295k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
295k
    }
622
832k
    if (_parent->has_projection()) {
623
252k
        const auto& projection = *_parent->_projection;
624
252k
        _projections.resize(projection.projections.size());
625
1.52M
        for (size_t i = 0; i < _projections.size(); i++) {
626
1.27M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
1.27M
        }
628
252k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
262k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
9.13k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
54.4k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
45.3k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
45.3k
                        state, _intermediate_projections[i][j]));
634
45.3k
            }
635
9.13k
        }
636
252k
    }
637
832k
    return Status::OK();
638
832k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
54.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
54.6k
    _conjuncts.resize(_parent->_conjuncts.size());
619
54.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
54.6k
    if (_parent->has_projection()) {
623
11.3k
        const auto& projection = *_parent->_projection;
624
11.3k
        _projections.resize(projection.projections.size());
625
109k
        for (size_t i = 0; i < _projections.size(); i++) {
626
98.5k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
98.5k
        }
628
11.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
11.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
159
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
3.41k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
3.25k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
3.25k
                        state, _intermediate_projections[i][j]));
634
3.25k
            }
635
159
        }
636
11.3k
    }
637
54.6k
    return Status::OK();
638
54.6k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
25
    _conjuncts.resize(_parent->_conjuncts.size());
619
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
25
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
25
    return Status::OK();
638
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
4.46k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
4.46k
    _conjuncts.resize(_parent->_conjuncts.size());
619
4.93k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
471
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
471
    }
622
4.46k
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
4.46k
    return Status::OK();
638
4.46k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
584
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
584
    _conjuncts.resize(_parent->_conjuncts.size());
619
584
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
584
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
584
    return Status::OK();
638
584
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
5.27k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
5.27k
    _conjuncts.resize(_parent->_conjuncts.size());
619
5.27k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
5.27k
    if (_parent->has_projection()) {
623
60
        const auto& projection = *_parent->_projection;
624
60
        _projections.resize(projection.projections.size());
625
228
        for (size_t i = 0; i < _projections.size(); i++) {
626
168
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
168
        }
628
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
60
    }
637
5.27k
    return Status::OK();
638
5.27k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
610k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
610k
    _conjuncts.resize(_parent->_conjuncts.size());
619
610k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
0
    }
622
610k
    if (_parent->has_projection()) {
623
0
        const auto& projection = *_parent->_projection;
624
0
        _projections.resize(projection.projections.size());
625
0
        for (size_t i = 0; i < _projections.size(); i++) {
626
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
0
        }
628
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
0
                        state, _intermediate_projections[i][j]));
634
0
            }
635
0
        }
636
0
    }
637
610k
    return Status::OK();
638
610k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
617
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
618
169
    _conjuncts.resize(_parent->_conjuncts.size());
619
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
620
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
621
7
    }
622
169
    if (_parent->has_projection()) {
623
166
        const auto& projection = *_parent->_projection;
624
166
        _projections.resize(projection.projections.size());
625
491
        for (size_t i = 0; i < _projections.size(); i++) {
626
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
627
325
        }
628
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
629
169
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
630
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
631
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
632
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
633
8
                        state, _intermediate_projections[i][j]));
634
8
            }
635
3
        }
636
166
    }
637
169
    return Status::OK();
638
169
}
639
640
template <typename SharedStateArg>
641
7.63k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
7.63k
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
7.63k
    _terminated = true;
646
7.63k
    return Status::OK();
647
7.63k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
551
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
551
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
551
    _terminated = true;
646
551
    return Status::OK();
647
551
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
17
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
17
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
17
    _terminated = true;
646
17
    return Status::OK();
647
17
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
36
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
36
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
36
    _terminated = true;
646
36
    return Status::OK();
647
36
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
33
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
33
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
33
    _terminated = true;
646
33
    return Status::OK();
647
33
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
2
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
2
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
2
    _terminated = true;
646
2
    return Status::OK();
647
2
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
5.94k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
5.94k
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
5.94k
    _terminated = true;
646
5.94k
    return Status::OK();
647
5.94k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
62
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
62
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
62
    _terminated = true;
646
62
    return Status::OK();
647
62
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
4
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
4
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
4
    _terminated = true;
646
4
    return Status::OK();
647
4
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
944
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
944
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
944
    _terminated = true;
646
944
    return Status::OK();
647
944
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
641
37
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
642
37
    if (_terminated) {
643
0
        return Status::OK();
644
0
    }
645
37
    _terminated = true;
646
37
    return Status::OK();
647
37
}
648
649
template <typename SharedStateArg>
650
2.20M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
2.20M
    if (_closed) {
652
251k
        return Status::OK();
653
251k
    }
654
1.95M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
1.12M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
1.12M
    }
657
1.95M
    _closed = true;
658
1.95M
    return Status::OK();
659
2.20M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
65.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
65.7k
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
65.7k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
65.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
65.7k
    }
657
65.7k
    _closed = true;
658
65.7k
    return Status::OK();
659
65.7k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
4
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
4
    }
657
4
    _closed = true;
658
4
    return Status::OK();
659
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
445k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
445k
    if (_closed) {
652
223k
        return Status::OK();
653
223k
    }
654
222k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
222k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
222k
    }
657
222k
    _closed = true;
658
222k
    return Status::OK();
659
445k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
26
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
26
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
26
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
26
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
26
    }
657
26
    _closed = true;
658
26
    return Status::OK();
659
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
5.93k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
5.93k
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
5.93k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
5.93k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
5.93k
    }
657
5.93k
    _closed = true;
658
5.93k
    return Status::OK();
659
5.93k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
15.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
15.2k
    if (_closed) {
652
7.72k
        return Status::OK();
653
7.72k
    }
654
7.51k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
7.51k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
7.51k
    }
657
7.51k
    _closed = true;
658
7.51k
    return Status::OK();
659
15.2k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
83.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
83.9k
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
83.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
83.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
83.9k
    }
657
83.9k
    _closed = true;
658
83.9k
    return Status::OK();
659
83.9k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
60.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
60.5k
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
60.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
60.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
60.5k
    }
657
60.5k
    _closed = true;
658
60.5k
    return Status::OK();
659
60.5k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
19
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
19
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
19
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
19
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
19
    }
657
19
    _closed = true;
658
19
    return Status::OK();
659
19
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
847k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
847k
    if (_closed) {
652
14.5k
        return Status::OK();
653
14.5k
    }
654
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
    }
657
833k
    _closed = true;
658
833k
    return Status::OK();
659
847k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
54.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
54.6k
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
54.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
54.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
54.6k
    }
657
54.6k
    _closed = true;
658
54.6k
    return Status::OK();
659
54.6k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
28
    if (_closed) {
652
14
        return Status::OK();
653
14
    }
654
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
14
    }
657
14
    _closed = true;
658
14
    return Status::OK();
659
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
4.44k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
4.44k
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
4.44k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
4.44k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
4.44k
    }
657
4.44k
    _closed = true;
658
4.44k
    return Status::OK();
659
4.44k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
963
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
963
    if (_closed) {
652
482
        return Status::OK();
653
482
    }
654
481
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
481
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
481
    }
657
481
    _closed = true;
658
481
    return Status::OK();
659
963
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
10.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
10.8k
    if (_closed) {
652
5.54k
        return Status::OK();
653
5.54k
    }
654
5.25k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
5.25k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
5.25k
    }
657
5.25k
    _closed = true;
658
5.25k
    return Status::OK();
659
10.8k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
611k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
611k
    if (_closed) {
652
0
        return Status::OK();
653
0
    }
654
611k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
611k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
611k
    }
657
611k
    _closed = true;
658
611k
    return Status::OK();
659
611k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
650
335
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
651
335
    if (_closed) {
652
175
        return Status::OK();
653
175
    }
654
160
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
655
160
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
656
160
    }
657
160
    _closed = true;
658
160
    return Status::OK();
659
335
}
660
661
template <typename SharedState>
662
1.64M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
1.64M
    _operator_profile =
665
1.64M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
1.64M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
1.64M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
1.64M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
1.64M
    _operator_profile->add_child(_common_profile, true);
674
1.64M
    _operator_profile->add_child(_custom_profile, true);
675
676
1.64M
    _operator_profile->set_metadata(_parent->node_id());
677
1.64M
    _wait_for_finish_dependency_timer =
678
1.64M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
1.64M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
1.64M
    if constexpr (!is_fake_shared) {
681
1.15M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
1.15M
            info.shared_state_map.end()) {
683
303k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
230k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
230k
            }
686
303k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
303k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
303k
                                                  ? 0
689
303k
                                                  : info.task_idx]
690
303k
                                  .get();
691
303k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
848k
        } else {
693
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
18.4E
                DCHECK(false);
695
18.4E
            }
696
848k
            _shared_state = info.shared_state->template cast<SharedState>();
697
848k
            _dependency = _shared_state->create_sink_dependency(
698
848k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
848k
        }
700
1.15M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
1.15M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
1.15M
    }
703
704
1.64M
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
1.64M
    _rows_input_counter =
709
1.64M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
1.64M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
1.64M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
1.64M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
1.64M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
1.64M
    _memory_used_counter =
715
1.64M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
1.64M
    _common_profile->add_info_string("IsColocate",
717
1.64M
                                     std::to_string(_parent->is_colocated_operator()));
718
1.64M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
1.64M
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
1.64M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
1.64M
    return Status::OK();
722
1.64M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
113k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
113k
    _operator_profile =
665
113k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
113k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
113k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
113k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
113k
    _operator_profile->add_child(_common_profile, true);
674
113k
    _operator_profile->add_child(_custom_profile, true);
675
676
113k
    _operator_profile->set_metadata(_parent->node_id());
677
113k
    _wait_for_finish_dependency_timer =
678
113k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
113k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
113k
    if constexpr (!is_fake_shared) {
681
113k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
113k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
12.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
12.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
12.5k
                                                  ? 0
689
12.5k
                                                  : info.task_idx]
690
12.5k
                                  .get();
691
12.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
101k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
101k
            _shared_state = info.shared_state->template cast<SharedState>();
697
101k
            _dependency = _shared_state->create_sink_dependency(
698
101k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
101k
        }
700
113k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
113k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
113k
    }
703
704
113k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
113k
    _rows_input_counter =
709
113k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
113k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
113k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
113k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
113k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
113k
    _memory_used_counter =
715
113k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
113k
    _common_profile->add_info_string("IsColocate",
717
113k
                                     std::to_string(_parent->is_colocated_operator()));
718
113k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
113k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
113k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
113k
    return Status::OK();
722
113k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
2
    _operator_profile =
665
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
2
    _operator_profile->add_child(_common_profile, true);
674
2
    _operator_profile->add_child(_custom_profile, true);
675
676
2
    _operator_profile->set_metadata(_parent->node_id());
677
2
    _wait_for_finish_dependency_timer =
678
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
2
    if constexpr (!is_fake_shared) {
681
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
2
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
2
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
2
            _shared_state = info.shared_state->template cast<SharedState>();
697
2
            _dependency = _shared_state->create_sink_dependency(
698
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
2
        }
700
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
2
    }
703
704
2
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
2
    _rows_input_counter =
709
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
2
    _memory_used_counter =
715
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
2
    _common_profile->add_info_string("IsColocate",
717
2
                                     std::to_string(_parent->is_colocated_operator()));
718
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
2
    return Status::OK();
722
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
222k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
222k
    _operator_profile =
665
222k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
222k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
222k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
222k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
222k
    _operator_profile->add_child(_common_profile, true);
674
222k
    _operator_profile->add_child(_custom_profile, true);
675
676
222k
    _operator_profile->set_metadata(_parent->node_id());
677
222k
    _wait_for_finish_dependency_timer =
678
222k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
222k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
222k
    if constexpr (!is_fake_shared) {
681
222k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
222k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
222k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
222k
            _shared_state = info.shared_state->template cast<SharedState>();
697
222k
            _dependency = _shared_state->create_sink_dependency(
698
222k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
222k
        }
700
222k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
222k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
222k
    }
703
704
222k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
222k
    _rows_input_counter =
709
222k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
222k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
222k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
222k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
222k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
222k
    _memory_used_counter =
715
222k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
222k
    _common_profile->add_info_string("IsColocate",
717
222k
                                     std::to_string(_parent->is_colocated_operator()));
718
222k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
222k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
222k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
222k
    return Status::OK();
722
222k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
33
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
33
    _operator_profile =
665
33
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
33
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
33
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
33
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
33
    _operator_profile->add_child(_common_profile, true);
674
33
    _operator_profile->add_child(_custom_profile, true);
675
676
33
    _operator_profile->set_metadata(_parent->node_id());
677
33
    _wait_for_finish_dependency_timer =
678
33
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
33
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
33
    if constexpr (!is_fake_shared) {
681
33
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
33
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
33
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
33
            _shared_state = info.shared_state->template cast<SharedState>();
697
33
            _dependency = _shared_state->create_sink_dependency(
698
33
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
33
        }
700
33
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
33
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
33
    }
703
704
33
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
33
    _rows_input_counter =
709
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
33
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
33
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
33
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
33
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
33
    _memory_used_counter =
715
33
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
33
    _common_profile->add_info_string("IsColocate",
717
33
                                     std::to_string(_parent->is_colocated_operator()));
718
33
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
33
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
33
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
33
    return Status::OK();
722
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
5.93k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
5.93k
    _operator_profile =
665
5.93k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
5.93k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
5.93k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
5.93k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
5.93k
    _operator_profile->add_child(_common_profile, true);
674
5.93k
    _operator_profile->add_child(_custom_profile, true);
675
676
5.93k
    _operator_profile->set_metadata(_parent->node_id());
677
5.93k
    _wait_for_finish_dependency_timer =
678
5.93k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
5.93k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
5.93k
    if constexpr (!is_fake_shared) {
681
5.93k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
5.93k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
5.93k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
5.93k
            _shared_state = info.shared_state->template cast<SharedState>();
697
5.93k
            _dependency = _shared_state->create_sink_dependency(
698
5.93k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
5.93k
        }
700
5.93k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
5.93k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
5.93k
    }
703
704
5.93k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
5.93k
    _rows_input_counter =
709
5.93k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
5.93k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
5.93k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
5.93k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
5.93k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
5.93k
    _memory_used_counter =
715
5.93k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
5.93k
    _common_profile->add_info_string("IsColocate",
717
5.93k
                                     std::to_string(_parent->is_colocated_operator()));
718
5.93k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
5.93k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
5.93k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
5.93k
    return Status::OK();
722
5.93k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
7.53k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
7.53k
    _operator_profile =
665
7.53k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
7.53k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
7.53k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
7.53k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
7.53k
    _operator_profile->add_child(_common_profile, true);
674
7.53k
    _operator_profile->add_child(_custom_profile, true);
675
676
7.53k
    _operator_profile->set_metadata(_parent->node_id());
677
7.53k
    _wait_for_finish_dependency_timer =
678
7.53k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
7.53k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
7.53k
    if constexpr (!is_fake_shared) {
681
7.53k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
7.53k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
7.53k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
7.53k
            _shared_state = info.shared_state->template cast<SharedState>();
697
7.53k
            _dependency = _shared_state->create_sink_dependency(
698
7.53k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
7.53k
        }
700
7.53k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
7.53k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
7.53k
    }
703
704
7.53k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
7.53k
    _rows_input_counter =
709
7.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
7.53k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
7.53k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
7.53k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
7.53k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
7.53k
    _memory_used_counter =
715
7.53k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
7.53k
    _common_profile->add_info_string("IsColocate",
717
7.53k
                                     std::to_string(_parent->is_colocated_operator()));
718
7.53k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
7.53k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
7.53k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
7.53k
    return Status::OK();
722
7.53k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
83.9k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
83.9k
    _operator_profile =
665
83.9k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
83.9k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
83.9k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
83.9k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
83.9k
    _operator_profile->add_child(_common_profile, true);
674
83.9k
    _operator_profile->add_child(_custom_profile, true);
675
676
83.9k
    _operator_profile->set_metadata(_parent->node_id());
677
83.9k
    _wait_for_finish_dependency_timer =
678
83.9k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
83.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
83.9k
    if constexpr (!is_fake_shared) {
681
83.9k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
83.9k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
83.9k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
83.9k
            _shared_state = info.shared_state->template cast<SharedState>();
697
83.9k
            _dependency = _shared_state->create_sink_dependency(
698
83.9k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
83.9k
        }
700
83.9k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
83.9k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
83.9k
    }
703
704
83.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
83.9k
    _rows_input_counter =
709
83.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
83.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
83.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
83.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
83.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
83.9k
    _memory_used_counter =
715
83.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
83.9k
    _common_profile->add_info_string("IsColocate",
717
83.9k
                                     std::to_string(_parent->is_colocated_operator()));
718
83.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
83.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
83.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
83.9k
    return Status::OK();
722
83.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
61.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
61.1k
    _operator_profile =
665
61.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
61.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
61.1k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
61.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
61.1k
    _operator_profile->add_child(_common_profile, true);
674
61.1k
    _operator_profile->add_child(_custom_profile, true);
675
676
61.1k
    _operator_profile->set_metadata(_parent->node_id());
677
61.1k
    _wait_for_finish_dependency_timer =
678
61.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
61.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
61.1k
    if constexpr (!is_fake_shared) {
681
61.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
61.2k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
61.2k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
61.2k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
61.2k
                                                  ? 0
689
61.2k
                                                  : info.task_idx]
690
61.2k
                                  .get();
691
61.2k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
18.4E
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
697
18.4E
            _dependency = _shared_state->create_sink_dependency(
698
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
18.4E
        }
700
61.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
61.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
61.1k
    }
703
704
61.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
61.1k
    _rows_input_counter =
709
61.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
61.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
61.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
61.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
61.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
61.1k
    _memory_used_counter =
715
61.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
61.1k
    _common_profile->add_info_string("IsColocate",
717
61.1k
                                     std::to_string(_parent->is_colocated_operator()));
718
61.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
61.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
61.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
61.1k
    return Status::OK();
722
61.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
30
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
30
    _operator_profile =
665
30
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
30
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
30
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
30
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
30
    _operator_profile->add_child(_common_profile, true);
674
30
    _operator_profile->add_child(_custom_profile, true);
675
676
30
    _operator_profile->set_metadata(_parent->node_id());
677
30
    _wait_for_finish_dependency_timer =
678
30
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
30
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
30
    if constexpr (!is_fake_shared) {
681
30
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
30
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
30
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
30
            _shared_state = info.shared_state->template cast<SharedState>();
697
30
            _dependency = _shared_state->create_sink_dependency(
698
30
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
30
        }
700
30
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
30
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
30
    }
703
704
30
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
30
    _rows_input_counter =
709
30
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
30
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
30
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
30
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
30
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
30
    _memory_used_counter =
715
30
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
30
    _common_profile->add_info_string("IsColocate",
717
30
                                     std::to_string(_parent->is_colocated_operator()));
718
30
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
30
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
30
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
30
    return Status::OK();
722
30
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
492k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
492k
    _operator_profile =
665
492k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
492k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
492k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
492k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
492k
    _operator_profile->add_child(_common_profile, true);
674
492k
    _operator_profile->add_child(_custom_profile, true);
675
676
492k
    _operator_profile->set_metadata(_parent->node_id());
677
492k
    _wait_for_finish_dependency_timer =
678
492k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
492k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
    if constexpr (!is_fake_shared) {
681
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
                                                  ? 0
689
                                                  : info.task_idx]
690
                                  .get();
691
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
            _shared_state = info.shared_state->template cast<SharedState>();
697
            _dependency = _shared_state->create_sink_dependency(
698
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
        }
700
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
    }
703
704
492k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
492k
    _rows_input_counter =
709
492k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
492k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
492k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
492k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
492k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
492k
    _memory_used_counter =
715
492k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
492k
    _common_profile->add_info_string("IsColocate",
717
492k
                                     std::to_string(_parent->is_colocated_operator()));
718
492k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
492k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
492k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
492k
    return Status::OK();
722
492k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
8.49k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
8.49k
    _operator_profile =
665
8.49k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
8.49k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
8.49k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
8.49k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
8.49k
    _operator_profile->add_child(_common_profile, true);
674
8.49k
    _operator_profile->add_child(_custom_profile, true);
675
676
8.49k
    _operator_profile->set_metadata(_parent->node_id());
677
8.49k
    _wait_for_finish_dependency_timer =
678
8.49k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
8.49k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
8.49k
    if constexpr (!is_fake_shared) {
681
8.49k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
8.49k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
8.49k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
8.49k
            _shared_state = info.shared_state->template cast<SharedState>();
697
8.49k
            _dependency = _shared_state->create_sink_dependency(
698
8.49k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
8.49k
        }
700
8.49k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
8.49k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
8.49k
    }
703
704
8.49k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
8.49k
    _rows_input_counter =
709
8.49k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
8.49k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
8.49k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
8.49k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
8.49k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
8.49k
    _memory_used_counter =
715
8.49k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
8.49k
    _common_profile->add_info_string("IsColocate",
717
8.49k
                                     std::to_string(_parent->is_colocated_operator()));
718
8.49k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
8.49k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
8.49k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
8.49k
    return Status::OK();
722
8.49k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
579
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
579
    _operator_profile =
665
579
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
579
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
579
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
579
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
579
    _operator_profile->add_child(_common_profile, true);
674
579
    _operator_profile->add_child(_custom_profile, true);
675
676
579
    _operator_profile->set_metadata(_parent->node_id());
677
579
    _wait_for_finish_dependency_timer =
678
579
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
579
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
579
    if constexpr (!is_fake_shared) {
681
579
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
579
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
579
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
579
            _shared_state = info.shared_state->template cast<SharedState>();
697
579
            _dependency = _shared_state->create_sink_dependency(
698
579
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
579
        }
700
579
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
579
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
579
    }
703
704
580
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
579
    _rows_input_counter =
709
579
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
579
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
579
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
579
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
579
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
579
    _memory_used_counter =
715
579
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
579
    _common_profile->add_info_string("IsColocate",
717
579
                                     std::to_string(_parent->is_colocated_operator()));
718
579
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
579
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
579
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
579
    return Status::OK();
722
579
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
1.83k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
1.83k
    _operator_profile =
665
1.83k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
1.83k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
1.83k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
1.83k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
1.83k
    _operator_profile->add_child(_common_profile, true);
674
1.83k
    _operator_profile->add_child(_custom_profile, true);
675
676
1.83k
    _operator_profile->set_metadata(_parent->node_id());
677
1.83k
    _wait_for_finish_dependency_timer =
678
1.83k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
1.83k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
1.83k
    if constexpr (!is_fake_shared) {
681
1.83k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
1.83k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
1.83k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
1.83k
            _shared_state = info.shared_state->template cast<SharedState>();
697
1.83k
            _dependency = _shared_state->create_sink_dependency(
698
1.83k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
1.83k
        }
700
1.83k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
1.83k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
1.83k
    }
703
704
1.83k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
1.83k
    _rows_input_counter =
709
1.83k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
1.83k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
1.83k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
1.83k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
1.83k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
1.83k
    _memory_used_counter =
715
1.83k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
1.83k
    _common_profile->add_info_string("IsColocate",
717
1.83k
                                     std::to_string(_parent->is_colocated_operator()));
718
1.83k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
1.83k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
1.83k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
1.83k
    return Status::OK();
722
1.83k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
12.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
12.7k
    _operator_profile =
665
12.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
12.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
12.7k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
12.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
12.7k
    _operator_profile->add_child(_common_profile, true);
674
12.7k
    _operator_profile->add_child(_custom_profile, true);
675
676
12.7k
    _operator_profile->set_metadata(_parent->node_id());
677
12.7k
    _wait_for_finish_dependency_timer =
678
12.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
12.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
12.7k
    if constexpr (!is_fake_shared) {
681
12.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
12.7k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
12.7k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
12.7k
            _shared_state = info.shared_state->template cast<SharedState>();
697
12.7k
            _dependency = _shared_state->create_sink_dependency(
698
12.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
12.7k
        }
700
12.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
12.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
12.7k
    }
703
704
12.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
12.7k
    _rows_input_counter =
709
12.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
12.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
12.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
12.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
12.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
12.7k
    _memory_used_counter =
715
12.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
12.7k
    _common_profile->add_info_string("IsColocate",
717
12.7k
                                     std::to_string(_parent->is_colocated_operator()));
718
12.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
12.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
12.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
12.7k
    return Status::OK();
722
12.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
229k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
229k
    _operator_profile =
665
229k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
229k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
229k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
229k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
229k
    _operator_profile->add_child(_common_profile, true);
674
229k
    _operator_profile->add_child(_custom_profile, true);
675
676
229k
    _operator_profile->set_metadata(_parent->node_id());
677
229k
    _wait_for_finish_dependency_timer =
678
229k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
229k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
229k
    if constexpr (!is_fake_shared) {
681
229k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
230k
            info.shared_state_map.end()) {
683
230k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
230k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
230k
            }
686
230k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
230k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
230k
                                                  ? 0
689
230k
                                                  : info.task_idx]
690
230k
                                  .get();
691
230k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
18.4E
        } else {
693
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
18.4E
                DCHECK(false);
695
18.4E
            }
696
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
697
18.4E
            _dependency = _shared_state->create_sink_dependency(
698
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
18.4E
        }
700
229k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
229k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
229k
    }
703
704
229k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
229k
    _rows_input_counter =
709
229k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
229k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
229k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
229k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
229k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
229k
    _memory_used_counter =
715
229k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
229k
    _common_profile->add_info_string("IsColocate",
717
229k
                                     std::to_string(_parent->is_colocated_operator()));
718
229k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
229k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
229k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
229k
    return Status::OK();
722
229k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
403k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
403k
    _operator_profile =
665
403k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
403k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
403k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
403k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
403k
    _operator_profile->add_child(_common_profile, true);
674
403k
    _operator_profile->add_child(_custom_profile, true);
675
676
403k
    _operator_profile->set_metadata(_parent->node_id());
677
403k
    _wait_for_finish_dependency_timer =
678
403k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
403k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
403k
    if constexpr (!is_fake_shared) {
681
403k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
403k
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
403k
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
403k
            _shared_state = info.shared_state->template cast<SharedState>();
697
403k
            _dependency = _shared_state->create_sink_dependency(
698
403k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
403k
        }
700
403k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
403k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
403k
    }
703
704
403k
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
403k
    _rows_input_counter =
709
403k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
403k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
403k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
403k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
403k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
403k
    _memory_used_counter =
715
403k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
403k
    _common_profile->add_info_string("IsColocate",
717
403k
                                     std::to_string(_parent->is_colocated_operator()));
718
403k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
403k
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
403k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
403k
    return Status::OK();
722
403k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
25
    _operator_profile =
665
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
25
    _operator_profile->add_child(_common_profile, true);
674
25
    _operator_profile->add_child(_custom_profile, true);
675
676
25
    _operator_profile->set_metadata(_parent->node_id());
677
25
    _wait_for_finish_dependency_timer =
678
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
25
    if constexpr (!is_fake_shared) {
681
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
25
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
25
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
25
            _shared_state = info.shared_state->template cast<SharedState>();
697
25
            _dependency = _shared_state->create_sink_dependency(
698
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
25
        }
700
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
25
    }
703
704
25
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
25
    _rows_input_counter =
709
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
25
    _memory_used_counter =
715
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
25
    _common_profile->add_info_string("IsColocate",
717
25
                                     std::to_string(_parent->is_colocated_operator()));
718
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
25
    return Status::OK();
722
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
662
338
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
663
    // create profile
664
338
    _operator_profile =
665
338
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
666
338
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
667
338
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
668
669
    // indentation is true
670
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
671
    // So we should set the indentation to true.
672
338
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
673
338
    _operator_profile->add_child(_common_profile, true);
674
338
    _operator_profile->add_child(_custom_profile, true);
675
676
338
    _operator_profile->set_metadata(_parent->node_id());
677
338
    _wait_for_finish_dependency_timer =
678
338
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
679
338
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
680
338
    if constexpr (!is_fake_shared) {
681
338
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
682
338
            info.shared_state_map.end()) {
683
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
684
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
685
            }
686
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
687
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
688
0
                                                  ? 0
689
0
                                                  : info.task_idx]
690
0
                                  .get();
691
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
692
338
        } else {
693
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
694
                DCHECK(false);
695
            }
696
338
            _shared_state = info.shared_state->template cast<SharedState>();
697
338
            _dependency = _shared_state->create_sink_dependency(
698
338
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
699
338
        }
700
338
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
701
338
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
702
338
    }
703
704
338
    if (must_set_shared_state() && _shared_state == nullptr) {
705
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
706
0
    }
707
708
338
    _rows_input_counter =
709
338
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
710
338
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
711
338
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
712
338
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
713
338
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
714
338
    _memory_used_counter =
715
338
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
716
338
    _common_profile->add_info_string("IsColocate",
717
338
                                     std::to_string(_parent->is_colocated_operator()));
718
338
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
719
338
    _common_profile->add_info_string("FollowedByShuffledOperator",
720
338
                                     std::to_string(_parent->followed_by_shuffled_operator()));
721
338
    return Status::OK();
722
338
}
723
724
template <typename SharedState>
725
1.65M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
1.65M
    if (_closed) {
727
2
        return Status::OK();
728
2
    }
729
1.65M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
1.15M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
1.15M
    }
732
1.65M
    _closed = true;
733
1.65M
    return Status::OK();
734
1.65M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
113k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
113k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
113k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
113k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
113k
    }
732
113k
    _closed = true;
733
113k
    return Status::OK();
734
113k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
1
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
1
    }
732
1
    _closed = true;
733
1
    return Status::OK();
734
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
223k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
223k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
223k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
223k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
223k
    }
732
223k
    _closed = true;
733
223k
    return Status::OK();
734
223k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
24
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
24
    if (_closed) {
727
2
        return Status::OK();
728
2
    }
729
22
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
22
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
22
    }
732
22
    _closed = true;
733
22
    return Status::OK();
734
24
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
5.92k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
5.92k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
5.92k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
5.92k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
5.92k
    }
732
5.92k
    _closed = true;
733
5.92k
    return Status::OK();
734
5.92k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
7.48k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
7.48k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
7.48k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
7.48k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
7.48k
    }
732
7.48k
    _closed = true;
733
7.48k
    return Status::OK();
734
7.48k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
83.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
83.8k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
83.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
83.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
83.8k
    }
732
83.8k
    _closed = true;
733
83.8k
    return Status::OK();
734
83.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
60.5k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
60.5k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
60.5k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
60.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
60.5k
    }
732
60.5k
    _closed = true;
733
60.5k
    return Status::OK();
734
60.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
19
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
19
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
19
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
19
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
19
    }
732
19
    _closed = true;
733
19
    return Status::OK();
734
19
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
497k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
497k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
    }
732
497k
    _closed = true;
733
497k
    return Status::OK();
734
497k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
8.53k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
8.53k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
8.53k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
8.53k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
8.53k
    }
732
8.53k
    _closed = true;
733
8.53k
    return Status::OK();
734
8.53k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
481
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
481
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
481
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
481
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
481
    }
732
481
    _closed = true;
733
481
    return Status::OK();
734
481
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
1.83k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
1.83k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
1.83k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
1.83k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
1.83k
    }
732
1.83k
    _closed = true;
733
1.83k
    return Status::OK();
734
1.83k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
12.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
12.7k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
12.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
12.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
12.7k
    }
732
12.7k
    _closed = true;
733
12.7k
    return Status::OK();
734
12.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
230k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
230k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
230k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
230k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
230k
    }
732
230k
    _closed = true;
733
230k
    return Status::OK();
734
230k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
404k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
404k
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
404k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
404k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
404k
    }
732
404k
    _closed = true;
733
404k
    return Status::OK();
734
404k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
14
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
14
    }
732
14
    _closed = true;
733
14
    return Status::OK();
734
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
725
338
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
726
338
    if (_closed) {
727
0
        return Status::OK();
728
0
    }
729
338
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
730
338
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
731
338
    }
732
338
    _closed = true;
733
338
    return Status::OK();
734
338
}
735
736
template <typename LocalStateType>
737
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
738
4.00k
                                                          bool* eos) {
739
4.00k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
740
4.00k
    return pull(state, block, eos);
741
4.00k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
738
38
                                                          bool* eos) {
739
38
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
740
38
    return pull(state, block, eos);
741
38
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
738
3.97k
                                                          bool* eos) {
739
3.97k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
740
3.96k
    return pull(state, block, eos);
741
3.97k
}
742
743
template <typename LocalStateType>
744
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
745
511k
                                                         bool* eos) {
746
511k
    auto& local_state = get_local_state(state);
747
511k
    if (need_more_input_data(state)) {
748
481k
        local_state._child_block->clear_column_data(
749
481k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
481k
                        .num_materialized_slots());
751
481k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
481k
                state, local_state._child_block.get(), &local_state._child_eos));
753
481k
        *eos = local_state._child_eos;
754
481k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
58.5k
            return Status::OK();
756
58.5k
        }
757
422k
        {
758
422k
            SCOPED_TIMER(local_state.exec_time_counter());
759
422k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
422k
        }
761
422k
    }
762
763
452k
    if (!need_more_input_data(state)) {
764
427k
        SCOPED_TIMER(local_state.exec_time_counter());
765
427k
        bool new_eos = false;
766
427k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
427k
        if (new_eos) {
768
347k
            *eos = true;
769
347k
        } else if (!need_more_input_data(state)) {
770
24.1k
            *eos = false;
771
24.1k
        }
772
427k
    }
773
452k
    return Status::OK();
774
452k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
137k
                                                         bool* eos) {
746
137k
    auto& local_state = get_local_state(state);
747
137k
    if (need_more_input_data(state)) {
748
119k
        local_state._child_block->clear_column_data(
749
119k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
119k
                        .num_materialized_slots());
751
119k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
119k
                state, local_state._child_block.get(), &local_state._child_eos));
753
119k
        *eos = local_state._child_eos;
754
119k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
36.6k
            return Status::OK();
756
36.6k
        }
757
83.0k
        {
758
83.0k
            SCOPED_TIMER(local_state.exec_time_counter());
759
83.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
83.0k
        }
761
83.0k
    }
762
763
101k
    if (!need_more_input_data(state)) {
764
101k
        SCOPED_TIMER(local_state.exec_time_counter());
765
101k
        bool new_eos = false;
766
101k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
101k
        if (new_eos) {
768
41.3k
            *eos = true;
769
59.7k
        } else if (!need_more_input_data(state)) {
770
11.5k
            *eos = false;
771
11.5k
        }
772
101k
    }
773
101k
    return Status::OK();
774
101k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
4.25k
                                                         bool* eos) {
746
4.25k
    auto& local_state = get_local_state(state);
747
4.25k
    if (need_more_input_data(state)) {
748
2.36k
        local_state._child_block->clear_column_data(
749
2.36k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
2.36k
                        .num_materialized_slots());
751
2.36k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
2.36k
                state, local_state._child_block.get(), &local_state._child_eos));
753
2.36k
        *eos = local_state._child_eos;
754
2.36k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
442
            return Status::OK();
756
442
        }
757
1.92k
        {
758
1.92k
            SCOPED_TIMER(local_state.exec_time_counter());
759
1.92k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
1.92k
        }
761
1.92k
    }
762
763
3.83k
    if (!need_more_input_data(state)) {
764
3.83k
        SCOPED_TIMER(local_state.exec_time_counter());
765
3.83k
        bool new_eos = false;
766
3.83k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
3.83k
        if (new_eos) {
768
1.39k
            *eos = true;
769
2.43k
        } else if (!need_more_input_data(state)) {
770
1.89k
            *eos = false;
771
1.89k
        }
772
3.83k
    }
773
3.81k
    return Status::OK();
774
3.81k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
1.87k
                                                         bool* eos) {
746
1.87k
    auto& local_state = get_local_state(state);
747
1.87k
    if (need_more_input_data(state)) {
748
1.87k
        local_state._child_block->clear_column_data(
749
1.87k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
1.87k
                        .num_materialized_slots());
751
1.87k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
1.87k
                state, local_state._child_block.get(), &local_state._child_eos));
753
1.87k
        *eos = local_state._child_eos;
754
1.87k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
764
            return Status::OK();
756
764
        }
757
1.11k
        {
758
1.11k
            SCOPED_TIMER(local_state.exec_time_counter());
759
1.11k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
1.11k
        }
761
1.11k
    }
762
763
1.11k
    if (!need_more_input_data(state)) {
764
1.11k
        SCOPED_TIMER(local_state.exec_time_counter());
765
1.11k
        bool new_eos = false;
766
1.11k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
1.11k
        if (new_eos) {
768
781
            *eos = true;
769
781
        } else if (!need_more_input_data(state)) {
770
0
            *eos = false;
771
0
        }
772
1.11k
    }
773
1.11k
    return Status::OK();
774
1.11k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
14.2k
                                                         bool* eos) {
746
14.2k
    auto& local_state = get_local_state(state);
747
14.2k
    if (need_more_input_data(state)) {
748
14.2k
        local_state._child_block->clear_column_data(
749
14.2k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
14.2k
                        .num_materialized_slots());
751
14.2k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
14.2k
                state, local_state._child_block.get(), &local_state._child_eos));
753
14.2k
        *eos = local_state._child_eos;
754
14.2k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
4.55k
            return Status::OK();
756
4.55k
        }
757
9.66k
        {
758
9.66k
            SCOPED_TIMER(local_state.exec_time_counter());
759
9.66k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
9.66k
        }
761
9.66k
    }
762
763
9.67k
    if (!need_more_input_data(state)) {
764
5.68k
        SCOPED_TIMER(local_state.exec_time_counter());
765
5.68k
        bool new_eos = false;
766
5.68k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
5.68k
        if (new_eos) {
768
5.61k
            *eos = true;
769
5.61k
        } else if (!need_more_input_data(state)) {
770
9
            *eos = false;
771
9
        }
772
5.68k
    }
773
9.67k
    return Status::OK();
774
9.67k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
324k
                                                         bool* eos) {
746
324k
    auto& local_state = get_local_state(state);
747
325k
    if (need_more_input_data(state)) {
748
325k
        local_state._child_block->clear_column_data(
749
325k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
325k
                        .num_materialized_slots());
751
325k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
325k
                state, local_state._child_block.get(), &local_state._child_eos));
753
325k
        *eos = local_state._child_eos;
754
325k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
14.8k
            return Status::OK();
756
14.8k
        }
757
310k
        {
758
310k
            SCOPED_TIMER(local_state.exec_time_counter());
759
310k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
310k
        }
761
310k
    }
762
763
309k
    if (!need_more_input_data(state)) {
764
288k
        SCOPED_TIMER(local_state.exec_time_counter());
765
288k
        bool new_eos = false;
766
288k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
288k
        if (new_eos) {
768
288k
            *eos = true;
769
288k
        } else if (!need_more_input_data(state)) {
770
0
            *eos = false;
771
0
        }
772
288k
    }
773
309k
    return Status::OK();
774
309k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
21.8k
                                                         bool* eos) {
746
21.8k
    auto& local_state = get_local_state(state);
747
21.8k
    if (need_more_input_data(state)) {
748
11.5k
        local_state._child_block->clear_column_data(
749
11.5k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
11.5k
                        .num_materialized_slots());
751
11.5k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
11.5k
                state, local_state._child_block.get(), &local_state._child_eos));
753
11.5k
        *eos = local_state._child_eos;
754
11.5k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
543
            return Status::OK();
756
543
        }
757
10.9k
        {
758
10.9k
            SCOPED_TIMER(local_state.exec_time_counter());
759
10.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
10.9k
        }
761
10.9k
    }
762
763
21.3k
    if (!need_more_input_data(state)) {
764
20.7k
        SCOPED_TIMER(local_state.exec_time_counter());
765
20.7k
        bool new_eos = false;
766
20.7k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
20.7k
        if (new_eos) {
768
5.90k
            *eos = true;
769
14.7k
        } else if (!need_more_input_data(state)) {
770
10.3k
            *eos = false;
771
10.3k
        }
772
20.7k
    }
773
21.3k
    return Status::OK();
774
21.3k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
745
6.86k
                                                         bool* eos) {
746
6.86k
    auto& local_state = get_local_state(state);
747
6.86k
    if (need_more_input_data(state)) {
748
6.50k
        local_state._child_block->clear_column_data(
749
6.50k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
750
6.50k
                        .num_materialized_slots());
751
6.50k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
752
6.50k
                state, local_state._child_block.get(), &local_state._child_eos));
753
6.50k
        *eos = local_state._child_eos;
754
6.50k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
755
810
            return Status::OK();
756
810
        }
757
5.69k
        {
758
5.69k
            SCOPED_TIMER(local_state.exec_time_counter());
759
5.69k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
760
5.69k
        }
761
5.69k
    }
762
763
6.05k
    if (!need_more_input_data(state)) {
764
6.05k
        SCOPED_TIMER(local_state.exec_time_counter());
765
6.05k
        bool new_eos = false;
766
6.05k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
767
6.05k
        if (new_eos) {
768
4.00k
            *eos = true;
769
4.00k
        } else if (!need_more_input_data(state)) {
770
366
            *eos = false;
771
366
        }
772
6.05k
    }
773
6.04k
    return Status::OK();
774
6.04k
}
775
776
template <typename Writer, typename Parent>
777
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
778
45.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
779
45.6k
    RETURN_IF_ERROR(Base::init(state, info));
780
45.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
781
45.6k
                                                         "AsyncWriterDependency", true);
782
45.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
783
45.6k
                             _finish_dependency));
784
785
45.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
786
45.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
787
45.6k
    return Status::OK();
788
45.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
778
354
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
779
354
    RETURN_IF_ERROR(Base::init(state, info));
780
354
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
781
354
                                                         "AsyncWriterDependency", true);
782
354
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
783
354
                             _finish_dependency));
784
785
354
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
786
354
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
787
354
    return Status::OK();
788
354
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
778
45.2k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
779
45.2k
    RETURN_IF_ERROR(Base::init(state, info));
780
45.2k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
781
45.2k
                                                         "AsyncWriterDependency", true);
782
45.2k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
783
45.2k
                             _finish_dependency));
784
785
45.2k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
786
45.2k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
787
45.2k
    return Status::OK();
788
45.2k
}
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
789
790
template <typename Writer, typename Parent>
791
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
792
46.2k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
793
46.2k
    RETURN_IF_ERROR(Base::open(state));
794
46.2k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
795
355k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
796
309k
        RETURN_IF_ERROR(
797
309k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
798
309k
    }
799
46.2k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
800
46.2k
    return Status::OK();
801
46.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
792
354
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
793
354
    RETURN_IF_ERROR(Base::open(state));
794
354
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
795
1.84k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
796
1.48k
        RETURN_IF_ERROR(
797
1.48k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
798
1.48k
    }
799
354
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
800
354
    return Status::OK();
801
354
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
792
45.8k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
793
45.8k
    RETURN_IF_ERROR(Base::open(state));
794
45.8k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
795
353k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
796
307k
        RETURN_IF_ERROR(
797
307k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
798
307k
    }
799
45.8k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
800
45.8k
    return Status::OK();
801
45.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
802
803
template <typename Writer, typename Parent>
804
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
805
61.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
806
61.4k
    return _writer->sink(block, eos);
807
61.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
805
1.48k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
806
1.48k
    return _writer->sink(block, eos);
807
1.48k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
805
60.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
806
60.0k
    return _writer->sink(block, eos);
807
60.0k
}
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
808
809
template <typename Writer, typename Parent>
810
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
811
46.2k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
812
46.2k
    if (_closed) {
813
0
        return Status::OK();
814
0
    }
815
46.2k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
816
46.2k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
817
    // if the init failed, the _writer may be nullptr. so here need check
818
46.3k
    if (_writer) {
819
46.3k
        Status st = _writer->get_writer_status();
820
46.3k
        if (exec_status.ok()) {
821
46.2k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
822
46.2k
                                                       : Status::Cancelled("force close"));
823
46.2k
        } else {
824
45
            _writer->force_close(exec_status);
825
45
        }
826
        // If there is an error in process_block thread, then we should get the writer
827
        // status before call force_close. For example, the thread may failed in commit
828
        // transaction.
829
46.3k
        RETURN_IF_ERROR(st);
830
46.3k
    }
831
46.2k
    return Base::close(state, exec_status);
832
46.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
811
342
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
812
342
    if (_closed) {
813
0
        return Status::OK();
814
0
    }
815
342
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
816
342
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
817
    // if the init failed, the _writer may be nullptr. so here need check
818
342
    if (_writer) {
819
342
        Status st = _writer->get_writer_status();
820
342
        if (exec_status.ok()) {
821
342
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
822
342
                                                       : Status::Cancelled("force close"));
823
342
        } else {
824
0
            _writer->force_close(exec_status);
825
0
        }
826
        // If there is an error in process_block thread, then we should get the writer
827
        // status before call force_close. For example, the thread may failed in commit
828
        // transaction.
829
342
        RETURN_IF_ERROR(st);
830
342
    }
831
342
    return Base::close(state, exec_status);
832
342
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
811
45.9k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
812
45.9k
    if (_closed) {
813
0
        return Status::OK();
814
0
    }
815
45.9k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
816
45.9k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
817
    // if the init failed, the _writer may be nullptr. so here need check
818
45.9k
    if (_writer) {
819
45.9k
        Status st = _writer->get_writer_status();
820
45.9k
        if (exec_status.ok()) {
821
45.9k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
822
45.9k
                                                       : Status::Cancelled("force close"));
823
45.9k
        } else {
824
45
            _writer->force_close(exec_status);
825
45
        }
826
        // If there is an error in process_block thread, then we should get the writer
827
        // status before call force_close. For example, the thread may failed in commit
828
        // transaction.
829
45.9k
        RETURN_IF_ERROR(st);
830
45.9k
    }
831
45.8k
    return Base::close(state, exec_status);
832
45.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
833
834
// An instantiation added outside the macros below needs the matching
835
// 'extern template' declaration in the operator's header (enforced by
836
// build-support/check-extern-template-pairing.py). Instantiations expanded
837
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
838
// skipped -- so their extern pairing has to be kept in sync by hand.
839
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
840
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
841
DECLARE_OPERATOR(ResultSinkLocalState)
842
DECLARE_OPERATOR(JdbcTableSinkLocalState)
843
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
844
DECLARE_OPERATOR(ResultFileSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkLocalState)
846
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
847
DECLARE_OPERATOR(HiveTableSinkLocalState)
848
DECLARE_OPERATOR(TVFTableSinkLocalState)
849
DECLARE_OPERATOR(IcebergTableSinkLocalState)
850
DECLARE_OPERATOR(PaimonTableSinkLocalState)
851
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
852
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
853
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
854
DECLARE_OPERATOR(MCTableSinkLocalState)
855
DECLARE_OPERATOR(AnalyticSinkLocalState)
856
DECLARE_OPERATOR(BlackholeSinkLocalState)
857
DECLARE_OPERATOR(SortSinkLocalState)
858
DECLARE_OPERATOR(SpillSortSinkLocalState)
859
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
860
DECLARE_OPERATOR(AggSinkLocalState)
861
DECLARE_OPERATOR(BucketedAggSinkLocalState)
862
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
863
DECLARE_OPERATOR(ExchangeSinkLocalState)
864
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
865
DECLARE_OPERATOR(UnionSinkLocalState)
866
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
867
DECLARE_OPERATOR(PartitionSortSinkLocalState)
868
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
869
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
870
DECLARE_OPERATOR(SetSinkLocalState<true>)
871
DECLARE_OPERATOR(SetSinkLocalState<false>)
872
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
873
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
874
DECLARE_OPERATOR(CacheSinkLocalState)
875
DECLARE_OPERATOR(DictSinkLocalState)
876
DECLARE_OPERATOR(RecCTESinkLocalState)
877
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
878
879
#undef DECLARE_OPERATOR
880
881
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
882
DECLARE_OPERATOR(HashJoinProbeLocalState)
883
DECLARE_OPERATOR(OlapScanLocalState)
884
DECLARE_OPERATOR(GroupCommitLocalState)
885
DECLARE_OPERATOR(JDBCScanLocalState)
886
DECLARE_OPERATOR(FileScanLocalState)
887
DECLARE_OPERATOR(AnalyticLocalState)
888
DECLARE_OPERATOR(SortLocalState)
889
DECLARE_OPERATOR(SpillSortLocalState)
890
DECLARE_OPERATOR(LocalMergeSortLocalState)
891
DECLARE_OPERATOR(AggLocalState)
892
DECLARE_OPERATOR(BucketedAggLocalState)
893
DECLARE_OPERATOR(PartitionedAggLocalState)
894
DECLARE_OPERATOR(TableFunctionLocalState)
895
DECLARE_OPERATOR(ExchangeLocalState)
896
DECLARE_OPERATOR(RepeatLocalState)
897
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
898
DECLARE_OPERATOR(AssertNumRowsLocalState)
899
DECLARE_OPERATOR(EmptySetLocalState)
900
DECLARE_OPERATOR(UnionSourceLocalState)
901
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
902
DECLARE_OPERATOR(PartitionSortSourceLocalState)
903
DECLARE_OPERATOR(SetSourceLocalState<true>)
904
DECLARE_OPERATOR(SetSourceLocalState<false>)
905
DECLARE_OPERATOR(DataGenLocalState)
906
DECLARE_OPERATOR(SchemaScanLocalState)
907
DECLARE_OPERATOR(MetaScanLocalState)
908
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
909
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
910
DECLARE_OPERATOR(CacheSourceLocalState)
911
DECLARE_OPERATOR(RecCTESourceLocalState)
912
DECLARE_OPERATOR(RecCTEScanLocalState)
913
914
#ifdef BE_TEST
915
DECLARE_OPERATOR(MockLocalState)
916
DECLARE_OPERATOR(MockScanLocalState)
917
#endif
918
#undef DECLARE_OPERATOR
919
920
template class StreamingOperatorX<AssertNumRowsLocalState>;
921
template class StreamingOperatorX<SelectLocalState>;
922
923
template class StatefulOperatorX<HashJoinProbeLocalState>;
924
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
925
template class StatefulOperatorX<RepeatLocalState>;
926
template class StatefulOperatorX<MaterializationLocalState>;
927
template class StatefulOperatorX<StreamingAggLocalState>;
928
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
929
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
930
template class StatefulOperatorX<TableFunctionLocalState>;
931
932
template class PipelineXSinkLocalState<HashJoinSharedState>;
933
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
934
template class PipelineXSinkLocalState<SortSharedState>;
935
template class PipelineXSinkLocalState<SpillSortSharedState>;
936
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
937
template class PipelineXSinkLocalState<AnalyticSharedState>;
938
template class PipelineXSinkLocalState<AggSharedState>;
939
template class PipelineXSinkLocalState<BucketedAggSharedState>;
940
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
941
template class PipelineXSinkLocalState<FakeSharedState>;
942
template class PipelineXSinkLocalState<UnionSharedState>;
943
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
944
template class PipelineXSinkLocalState<MultiCastSharedState>;
945
template class PipelineXSinkLocalState<SetSharedState>;
946
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
947
template class PipelineXSinkLocalState<BasicSharedState>;
948
template class PipelineXSinkLocalState<DataQueueSharedState>;
949
template class PipelineXSinkLocalState<RecCTESharedState>;
950
951
template class PipelineXLocalState<HashJoinSharedState>;
952
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
953
template class PipelineXLocalState<SortSharedState>;
954
template class PipelineXLocalState<SpillSortSharedState>;
955
template class PipelineXLocalState<NestedLoopJoinSharedState>;
956
template class PipelineXLocalState<AnalyticSharedState>;
957
template class PipelineXLocalState<AggSharedState>;
958
template class PipelineXLocalState<BucketedAggSharedState>;
959
template class PipelineXLocalState<PartitionedAggSharedState>;
960
template class PipelineXLocalState<FakeSharedState>;
961
template class PipelineXLocalState<UnionSharedState>;
962
template class PipelineXLocalState<DataQueueSharedState>;
963
template class PipelineXLocalState<MultiCastSharedState>;
964
template class PipelineXLocalState<PartitionSortNodeSharedState>;
965
template class PipelineXLocalState<SetSharedState>;
966
template class PipelineXLocalState<LocalExchangeSharedState>;
967
template class PipelineXLocalState<BasicSharedState>;
968
template class PipelineXLocalState<RecCTESharedState>;
969
970
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
971
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
972
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
973
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
974
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
977
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
978
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
979
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
980
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
981
982
#ifdef BE_TEST
983
template class OperatorX<DummyOperatorLocalState>;
984
template class DataSinkOperatorX<DummySinkLocalState>;
985
#endif
986
987
} // namespace doris