Coverage Report

Created: 2026-09-14 18:37

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