Coverage Report

Created: 2026-05-17 20:45

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