Coverage Report

Created: 2026-07-31 18:01

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