Coverage Report

Created: 2026-08-21 12:13

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