Coverage Report

Created: 2026-09-18 12:16

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.65M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.65M
    if (_parent->nereids_id() == -1) {
122
862k
        return fmt::format("(id={})", _parent->node_id());
123
862k
    } else {
124
796k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
796k
    }
126
1.65M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
70.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
70.8k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
70.8k
    } else {
124
70.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
70.8k
    }
126
70.8k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1
    if (_parent->nereids_id() == -1) {
122
1
        return fmt::format("(id={})", _parent->node_id());
123
1
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
207k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
207k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
207k
    } else {
124
207k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
207k
    }
126
207k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
26
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
26
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.64k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.64k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.64k
    } else {
124
5.64k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.64k
    }
126
5.64k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
9.25k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
9.25k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
9.24k
    } else {
124
9.24k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
9.24k
    }
126
9.25k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
84.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
84.6k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
84.6k
    } else {
124
84.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
84.6k
    }
126
84.6k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
69.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
69.4k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
69.4k
    } else {
124
69.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
69.4k
    }
126
69.4k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
16
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
16
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
16
    } else {
124
16
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
16
    }
126
16
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
555k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
555k
    if (_parent->nereids_id() == -1) {
122
266k
        return fmt::format("(id={})", _parent->node_id());
123
288k
    } else {
124
288k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
288k
    }
126
555k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.9k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.9k
    } else {
124
54.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.9k
    }
126
54.9k
}
_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.86k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.86k
    if (_parent->nereids_id() == -1) {
122
4.86k
        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.86k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
457
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
457
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
355
    } else {
124
355
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
355
    }
126
457
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.27k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.27k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.26k
    } else {
124
5.26k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.26k
    }
126
5.27k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
590k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
590k
    if (_parent->nereids_id() == -1) {
122
590k
        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
590k
}
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.15M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.15M
    if (_parent->nereids_id() == -1) {
131
643k
        return fmt::format("(id={})", _parent->node_id());
132
643k
    } else {
133
510k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
510k
    }
135
1.15M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
119k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
119k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
119k
    } else {
133
119k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
119k
    }
135
119k
}
_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
211k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
211k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
211k
    } else {
133
211k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
211k
    }
135
211k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
33
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
33
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
33
    } else {
133
33
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
33
    }
135
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.67k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.67k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.67k
    } else {
133
5.67k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.67k
    }
135
5.67k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9.29k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9.29k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
9.28k
    } else {
133
9.28k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
9.28k
    }
135
9.29k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
85.1k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
85.1k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
85.0k
    } else {
133
85.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
85.0k
    }
135
85.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
69.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
69.3k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
69.3k
    } else {
133
69.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
69.3k
    }
135
69.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
26
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
26
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
26
    } else {
133
26
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
26
    }
135
26
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
9
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
9
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
10.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
10.4k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
10.4k
    } else {
133
10.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
10.4k
    }
135
10.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
457
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
457
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
355
    } else {
133
355
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
355
    }
135
457
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.7k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.7k
    if (_parent->nereids_id() == -1) {
131
12.7k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
233k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
234k
    if (_parent->nereids_id() == -1) {
131
234k
        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
233k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
396k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
396k
    if (_parent->nereids_id() == -1) {
131
396k
        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
396k
}
_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.5k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
32.5k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
32.5k
    _terminated = true;
143
32.5k
    return Status::OK();
144
32.5k
}
_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
4.11k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
4.11k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
4.11k
    _terminated = true;
143
4.11k
    return Status::OK();
144
4.11k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_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_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_ZN5doris23PipelineXSinkLocalStateINS_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.20k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.20k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.20k
    _terminated = true;
143
2.20k
    return Status::OK();
144
2.20k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
773
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
773
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
773
    _terminated = true;
143
773
    return Status::OK();
144
773
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
381
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
381
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
381
    _terminated = true;
143
381
    return Status::OK();
144
381
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
300
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
300
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
300
    _terminated = true;
143
300
    return Status::OK();
144
300
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
7
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
7
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
7
    _terminated = true;
143
7
    return Status::OK();
144
7
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
167
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
167
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
167
    _terminated = true;
143
167
    return Status::OK();
144
167
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
9
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
9
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
9
    _terminated = true;
143
9
    return Status::OK();
144
9
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
400
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
400
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
400
    _terminated = true;
143
400
    return Status::OK();
144
400
}
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
299k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
299k
    return _child && _child->is_serial_operator() && !is_source()
148
299k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
299k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
299k
}
151
152
23.8k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
23.8k
    if (!_child) {
154
22.8k
        return false;
155
22.8k
    }
156
946
    if (_child->is_serial_operator()) {
157
91
        return true;
158
91
    }
159
855
    const auto child_distribution = _child->required_data_distribution(state);
160
855
    return child_distribution.need_local_exchange() &&
161
855
           !is_shuffled_exchange(child_distribution.distribution_type);
162
946
}
163
164
template <typename SharedStateArg>
165
13.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
13.5k
    fmt::memory_buffer debug_string_buffer;
167
13.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
13.5k
    return fmt::to_string(debug_string_buffer);
169
13.5k
}
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
13.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
13.5k
    fmt::memory_buffer debug_string_buffer;
167
13.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
13.5k
    return fmt::to_string(debug_string_buffer);
169
13.5k
}
_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
13.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
13.5k
    fmt::memory_buffer debug_string_buffer;
174
13.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
13.5k
    return fmt::to_string(debug_string_buffer);
176
13.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
13.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
13.5k
    fmt::memory_buffer debug_string_buffer;
174
13.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
13.5k
    return fmt::to_string(debug_string_buffer);
176
13.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
13.5k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
13.5k
    fmt::memory_buffer debug_string_buffer;
180
13.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
13.5k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
13.5k
                   _is_serial_operator);
183
13.5k
    return fmt::to_string(debug_string_buffer);
184
13.5k
}
185
186
13.5k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
13.5k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
13.5k
}
189
190
654k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
654k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
654k
    _nereids_id = tnode.nereids_id;
193
654k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.85k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.85k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.85k
            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.85k
    }
206
654k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
654k
    _op_name = substr + "_OPERATOR";
208
209
654k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
654k
    } else if (tnode.__isset.conjuncts) {
212
271k
        for (const auto& conjunct : tnode.conjuncts) {
213
271k
            VExprContextSPtr context;
214
271k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
271k
            _conjuncts.emplace_back(context);
216
271k
        }
217
98.6k
    }
218
219
    // create the projections expr
220
654k
    if (tnode.__isset.projections) {
221
258k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
258k
    }
223
654k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.85k
        DCHECK(has_projection()) << "no final projections";
225
3.85k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.43k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.43k
            VExprContextSPtrs projections;
228
6.43k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.43k
            _projection->intermediate_projections.push_back(projections);
230
6.43k
        }
231
3.85k
    }
232
654k
    return Status::OK();
233
654k
}
234
235
680k
Status OperatorXBase::prepare(RuntimeState* state) {
236
680k
    for (auto& conjunct : _conjuncts) {
237
271k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
271k
    }
239
680k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
630k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
336k
            return a->execute_cost() < b->execute_cost();
242
336k
        });
243
630k
    };
244
245
680k
    if (has_projection()) {
246
258k
        auto& projection = *_projection;
247
264k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.43k
            const auto& input_row_desc =
249
6.43k
                    i == 0 ? operator_row_desc_before_projection()
250
6.43k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.43k
            RETURN_IF_ERROR(
252
6.43k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.43k
        }
254
258k
        const auto& final_projection_input_row_desc =
255
258k
                projection.intermediate_output_row_descriptors.empty()
256
258k
                        ? operator_row_desc_before_projection()
257
258k
                        : projection.intermediate_output_row_descriptors.back();
258
258k
        RETURN_IF_ERROR(
259
258k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
258k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
258k
                                                      projection.output_row_descriptor));
262
258k
    }
263
264
680k
    for (auto& conjunct : _conjuncts) {
265
271k
        RETURN_IF_ERROR(conjunct->open(state));
266
271k
    }
267
680k
    if (has_projection()) {
268
258k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
258k
        for (auto& projections : _projection->intermediate_projections) {
270
6.43k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.43k
        }
272
258k
    }
273
680k
    if (_child && !is_source()) {
274
99.2k
        RETURN_IF_ERROR(_child->prepare(state));
275
99.2k
    }
276
277
680k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
680k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
680k
    return Status::OK();
283
680k
}
284
285
9.27k
Status OperatorXBase::terminate(RuntimeState* state) {
286
9.27k
    if (_child && !is_source()) {
287
712
        RETURN_IF_ERROR(_child->terminate(state));
288
712
    }
289
9.27k
    auto result = state->get_local_state_result(operator_id());
290
9.27k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
9.27k
    return result.value()->terminate(state);
294
9.27k
}
295
296
4.50M
Status OperatorXBase::close(RuntimeState* state) {
297
4.50M
    if (_child && !is_source()) {
298
709k
        RETURN_IF_ERROR(_child->close(state));
299
709k
    }
300
4.50M
    auto result = state->get_local_state_result(operator_id());
301
4.50M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.50M
    return result.value()->close(state);
305
4.50M
}
306
307
278k
void PipelineXLocalStateBase::clear_origin_block() {
308
278k
    _origin_block.clear_column_data(
309
278k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
278k
}
311
312
664k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
664k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
664k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
664k
    return Status::OK();
317
664k
}
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
278k
                                     Block* output_block) const {
326
278k
    auto* local_state = state->get_local_state(operator_id());
327
278k
    SCOPED_TIMER(local_state->exec_time_counter());
328
278k
    SCOPED_TIMER(local_state->_projection_timer);
329
278k
    const size_t rows = origin_block->rows();
330
278k
    if (rows == 0) {
331
145k
        return Status::OK();
332
145k
    }
333
132k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
132k
    {
336
132k
        Block input_block = *origin_block;
337
338
132k
        ColumnsWithTypeAndName new_columns;
339
132k
        for (const auto& projections : local_state->_intermediate_projections) {
340
4.14k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
4.14k
            new_columns.resize(projections.size());
345
73.6k
            for (int i = 0; i < projections.size(); i++) {
346
69.5k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
69.5k
                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
69.5k
            }
355
4.13k
            Block tmp_block {new_columns};
356
4.13k
            input_block.swap(tmp_block);
357
4.13k
        }
358
359
132k
        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
132k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
132k
                output_block, _projection->output_row_descriptor);
368
132k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
132k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
132k
        Columns shared_columns(mutable_columns.size());
371
372
755k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
623k
            ColumnPtr column_ptr;
374
623k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
623k
            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
623k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
623k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
623k
            if (column_ptr->is_exclusive()) {
386
225k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
397k
            } else {
388
397k
                shared_columns[i] = std::move(column_ptr);
389
397k
            }
390
623k
        }
391
392
132k
        scoped_mutable_block.restore();
393
756k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
623k
            if (shared_columns[i]) {
395
397k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
397k
            }
397
623k
        }
398
132k
    }
399
400
0
    origin_block->clear_column_data(
401
132k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
132k
    DCHECK_EQ(output_block->rows(), rows);
403
404
132k
    return Status::OK();
405
132k
}
406
407
4.06M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.06M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.06M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.06M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.06M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.06M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.06M
            if (_debug_point_count++ % 2 == 0) {
414
4.06M
                return Status::OK();
415
4.06M
            }
416
4.06M
        }
417
4.06M
    });
418
419
4.06M
    Status status;
420
4.06M
    auto* local_state = state->get_local_state(operator_id());
421
4.06M
    Defer defer([&]() {
422
4.06M
        if (status.ok()) {
423
4.06M
            local_state->update_output_block_counters(*block);
424
4.06M
        }
425
4.05M
    });
426
4.06M
    if (has_projection()) {
427
278k
        local_state->clear_origin_block();
428
278k
        status = get_block(state, &local_state->_origin_block, eos);
429
278k
        if (UNLIKELY(!status.ok())) {
430
25
            return status;
431
25
        }
432
278k
        status = do_projections(state, &local_state->_origin_block, block);
433
278k
        return status;
434
278k
    }
435
3.78M
    status = get_block(state, block, eos);
436
3.78M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.78M
    return status;
438
3.78M
}
439
440
2.57M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.57M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.43k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.43k
        *eos = true;
444
9.43k
    }
445
446
2.57M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.57M
        auto op_name = to_lower(_parent->_op_name);
448
2.57M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.57M
        arg_op_name = to_lower(arg_op_name);
450
451
2.57M
        if (op_name == arg_op_name) {
452
2.57M
            *eos = true;
453
2.57M
        }
454
2.57M
    });
455
456
2.57M
    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.57M
}
461
462
32.5k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
32.5k
    auto result = state->get_sink_local_state_result();
464
32.5k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
32.5k
    return result.value()->terminate(state);
468
32.5k
}
469
470
13.5k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
13.5k
    fmt::memory_buffer debug_string_buffer;
472
473
13.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
13.5k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
13.5k
    return fmt::to_string(debug_string_buffer);
476
13.5k
}
477
478
13.5k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
13.5k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
13.5k
}
481
482
339k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
339k
    std::string op_name = "UNKNOWN_SINK";
484
339k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
340k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
340k
        op_name = it->second;
488
340k
    }
489
339k
    _name = op_name + "_OPERATOR";
490
339k
    return Status::OK();
491
339k
}
492
493
287k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
287k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
287k
    _nereids_id = tnode.nereids_id;
496
287k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
287k
    _name = substr + "_SINK_OPERATOR";
498
287k
    return Status::OK();
499
287k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.64M
                                                            LocalSinkStateInfo& info) {
504
1.64M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.64M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.64M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.64M
    return Status::OK();
508
1.64M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
119k
                                                            LocalSinkStateInfo& info) {
504
119k
    auto local_state = LocalStateType::create_unique(this, state);
505
119k
    RETURN_IF_ERROR(local_state->init(state, info));
506
119k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
119k
    return Status::OK();
508
119k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
350k
                                                            LocalSinkStateInfo& info) {
504
350k
    auto local_state = LocalStateType::create_unique(this, state);
505
350k
    RETURN_IF_ERROR(local_state->init(state, info));
506
350k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
350k
    return Status::OK();
508
350k
}
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
349
                                                            LocalSinkStateInfo& info) {
504
349
    auto local_state = LocalStateType::create_unique(this, state);
505
349
    RETURN_IF_ERROR(local_state->init(state, info));
506
349
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
349
    return Status::OK();
508
349
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
47.0k
                                                            LocalSinkStateInfo& info) {
504
47.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
47.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
47.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
47.0k
    return Status::OK();
508
47.0k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_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
9.29k
                                                            LocalSinkStateInfo& info) {
504
9.29k
    auto local_state = LocalStateType::create_unique(this, state);
505
9.29k
    RETURN_IF_ERROR(local_state->init(state, info));
506
9.29k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9.29k
    return Status::OK();
508
9.29k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6
                                                            LocalSinkStateInfo& info) {
504
6
    auto local_state = LocalStateType::create_unique(this, state);
505
6
    RETURN_IF_ERROR(local_state->init(state, info));
506
6
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6
    return Status::OK();
508
6
}
_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
33
                                                            LocalSinkStateInfo& info) {
504
33
    auto local_state = LocalStateType::create_unique(this, state);
505
33
    RETURN_IF_ERROR(local_state->init(state, info));
506
33
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
33
    return Status::OK();
508
33
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
234k
                                                            LocalSinkStateInfo& info) {
504
234k
    auto local_state = LocalStateType::create_unique(this, state);
505
234k
    RETURN_IF_ERROR(local_state->init(state, info));
506
234k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
234k
    return Status::OK();
508
234k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
85.2k
                                                            LocalSinkStateInfo& info) {
504
85.2k
    auto local_state = LocalStateType::create_unique(this, state);
505
85.2k
    RETURN_IF_ERROR(local_state->init(state, info));
506
85.2k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
85.2k
    return Status::OK();
508
85.2k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
69.3k
                                                            LocalSinkStateInfo& info) {
504
69.3k
    auto local_state = LocalStateType::create_unique(this, state);
505
69.3k
    RETURN_IF_ERROR(local_state->init(state, info));
506
69.3k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
69.3k
    return Status::OK();
508
69.3k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
26
                                                            LocalSinkStateInfo& info) {
504
26
    auto local_state = LocalStateType::create_unique(this, state);
505
26
    RETURN_IF_ERROR(local_state->init(state, info));
506
26
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
26
    return Status::OK();
508
26
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
480k
                                                            LocalSinkStateInfo& info) {
504
480k
    auto local_state = LocalStateType::create_unique(this, state);
505
480k
    RETURN_IF_ERROR(local_state->init(state, info));
506
480k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
480k
    return Status::OK();
508
480k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.67k
                                                            LocalSinkStateInfo& info) {
504
5.67k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.67k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.67k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.67k
    return Status::OK();
508
5.67k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
10.4k
                                                            LocalSinkStateInfo& info) {
504
10.4k
    auto local_state = LocalStateType::create_unique(this, state);
505
10.4k
    RETURN_IF_ERROR(local_state->init(state, info));
506
10.4k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
10.4k
    return Status::OK();
508
10.4k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.12k
                                                            LocalSinkStateInfo& info) {
504
2.12k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.12k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.12k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.12k
    return Status::OK();
508
2.12k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
355
                                                            LocalSinkStateInfo& info) {
504
355
    auto local_state = LocalStateType::create_unique(this, state);
505
355
    RETURN_IF_ERROR(local_state->init(state, info));
506
355
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
355
    return Status::OK();
508
355
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.84k
                                                            LocalSinkStateInfo& info) {
504
4.84k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.84k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.84k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.84k
    return Status::OK();
508
4.84k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.62k
                                                            LocalSinkStateInfo& info) {
504
2.62k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.62k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.62k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.62k
    return Status::OK();
508
2.62k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.68k
                                                            LocalSinkStateInfo& info) {
504
2.68k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.68k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.68k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.68k
    return Status::OK();
508
2.68k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.56k
                                                            LocalSinkStateInfo& info) {
504
2.56k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.56k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.56k
    return Status::OK();
508
2.56k
}
_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
560
                                                            LocalSinkStateInfo& info) {
504
560
    auto local_state = LocalStateType::create_unique(this, state);
505
560
    RETURN_IF_ERROR(local_state->init(state, info));
506
560
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
560
    return Status::OK();
508
560
}
_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
105
                                                            LocalSinkStateInfo& info) {
504
105
    auto local_state = LocalStateType::create_unique(this, state);
505
105
    RETURN_IF_ERROR(local_state->init(state, info));
506
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
105
    return Status::OK();
508
105
}
_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.30M
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.30M
    } else {
519
1.30M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.30M
        ss->id = operator_id();
521
1.30M
        for (auto& dest : dests_id()) {
522
1.29M
            ss->related_op_ids.insert(dest);
523
1.29M
        }
524
1.30M
        return ss;
525
1.30M
    }
526
1.30M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
105k
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
105k
    } else {
519
105k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
105k
        ss->id = operator_id();
521
105k
        for (auto& dest : dests_id()) {
522
105k
            ss->related_op_ids.insert(dest);
523
105k
        }
524
105k
        return ss;
525
105k
    }
526
105k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
351k
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
351k
    } else {
519
351k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
351k
        ss->id = operator_id();
521
351k
        for (auto& dest : dests_id()) {
522
349k
            ss->related_op_ids.insert(dest);
523
349k
        }
524
351k
        return ss;
525
351k
    }
526
351k
}
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
349
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
349
    } else {
519
349
        auto ss = LocalStateType::SharedStateType::create_shared();
520
349
        ss->id = operator_id();
521
349
        for (auto& dest : dests_id()) {
522
348
            ss->related_op_ids.insert(dest);
523
348
        }
524
349
        return ss;
525
349
    }
526
349
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
47.2k
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
47.2k
    } else {
519
47.2k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
47.2k
        ss->id = operator_id();
521
47.2k
        for (auto& dest : dests_id()) {
522
46.8k
            ss->related_op_ids.insert(dest);
523
46.8k
        }
524
47.2k
        return ss;
525
47.2k
    }
526
47.2k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_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
9.30k
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
9.30k
    } else {
519
9.30k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
9.30k
        ss->id = operator_id();
521
9.31k
        for (auto& dest : dests_id()) {
522
9.31k
            ss->related_op_ids.insert(dest);
523
9.31k
        }
524
9.30k
        return ss;
525
9.30k
    }
526
9.30k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6
    } else {
519
6
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6
        ss->id = operator_id();
521
6
        for (auto& dest : dests_id()) {
522
6
            ss->related_op_ids.insert(dest);
523
6
        }
524
6
        return ss;
525
6
    }
526
6
}
_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
35
        for (auto& dest : dests_id()) {
522
35
            ss->related_op_ids.insert(dest);
523
35
        }
524
35
        return ss;
525
35
    }
526
35
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
85.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
85.4k
    } else {
519
85.4k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
85.4k
        ss->id = operator_id();
521
85.4k
        for (auto& dest : dests_id()) {
522
85.4k
            ss->related_op_ids.insert(dest);
523
85.4k
        }
524
85.4k
        return ss;
525
85.4k
    }
526
85.4k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
25
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
25
    } else {
519
25
        auto ss = LocalStateType::SharedStateType::create_shared();
520
25
        ss->id = operator_id();
521
25
        for (auto& dest : dests_id()) {
522
25
            ss->related_op_ids.insert(dest);
523
25
        }
524
25
        return ss;
525
25
    }
526
25
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
481k
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
481k
    } else {
519
481k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
481k
        ss->id = operator_id();
521
481k
        for (auto& dest : dests_id()) {
522
476k
            ss->related_op_ids.insert(dest);
523
476k
        }
524
481k
        return ss;
525
481k
    }
526
481k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
5.68k
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
5.68k
    } else {
519
5.68k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
5.68k
        ss->id = operator_id();
521
5.68k
        for (auto& dest : dests_id()) {
522
5.68k
            ss->related_op_ids.insert(dest);
523
5.68k
        }
524
5.68k
        return ss;
525
5.68k
    }
526
5.68k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
458
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
458
    } else {
519
458
        auto ss = LocalStateType::SharedStateType::create_shared();
520
458
        ss->id = operator_id();
521
458
        for (auto& dest : dests_id()) {
522
455
            ss->related_op_ids.insert(dest);
523
455
        }
524
458
        return ss;
525
458
    }
526
458
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.66k
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.66k
    } else {
519
2.66k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.66k
        ss->id = operator_id();
521
2.66k
        for (auto& dest : dests_id()) {
522
2.66k
            ss->related_op_ids.insert(dest);
523
2.66k
        }
524
2.66k
        return ss;
525
2.66k
    }
526
2.66k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.57k
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.57k
    } else {
519
2.57k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.57k
        ss->id = operator_id();
521
2.57k
        for (auto& dest : dests_id()) {
522
2.56k
            ss->related_op_ids.insert(dest);
523
2.56k
        }
524
2.57k
        return ss;
525
2.57k
    }
526
2.57k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
567
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
567
    } else {
519
567
        auto ss = LocalStateType::SharedStateType::create_shared();
520
567
        ss->id = operator_id();
521
567
        for (auto& dest : dests_id()) {
522
562
            ss->related_op_ids.insert(dest);
523
562
        }
524
567
        return ss;
525
567
    }
526
567
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
105
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
105
    } else {
519
105
        auto ss = LocalStateType::SharedStateType::create_shared();
520
105
        ss->id = operator_id();
521
105
        for (auto& dest : dests_id()) {
522
105
            ss->related_op_ids.insert(dest);
523
105
        }
524
105
        return ss;
525
105
    }
526
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.91M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.91M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.91M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.91M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.91M
    return Status::OK();
534
1.91M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
71.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
71.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
71.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
71.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
71.1k
    return Status::OK();
534
71.1k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
246k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
246k
    auto local_state = LocalStateType::create_unique(state, this);
531
246k
    RETURN_IF_ERROR(local_state->init(state, info));
532
246k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
246k
    return Status::OK();
534
246k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
136
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
136
    auto local_state = LocalStateType::create_unique(state, this);
531
136
    RETURN_IF_ERROR(local_state->init(state, info));
532
136
    state->emplace_local_state(operator_id(), std::move(local_state));
533
136
    return Status::OK();
534
136
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
9.28k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
9.28k
    auto local_state = LocalStateType::create_unique(state, this);
531
9.28k
    RETURN_IF_ERROR(local_state->init(state, info));
532
9.28k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
9.28k
    return Status::OK();
534
9.28k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
9.10k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
9.10k
    auto local_state = LocalStateType::create_unique(state, this);
531
9.10k
    RETURN_IF_ERROR(local_state->init(state, info));
532
9.10k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
9.10k
    return Status::OK();
534
9.10k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
26
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
26
    auto local_state = LocalStateType::create_unique(state, this);
531
26
    RETURN_IF_ERROR(local_state->init(state, info));
532
26
    state->emplace_local_state(operator_id(), std::move(local_state));
533
26
    return Status::OK();
534
26
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
201k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
201k
    auto local_state = LocalStateType::create_unique(state, this);
531
201k
    RETURN_IF_ERROR(local_state->init(state, info));
532
201k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
201k
    return Status::OK();
534
201k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
85.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
85.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
85.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
85.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
85.0k
    return Status::OK();
534
85.0k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
69.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
69.6k
    auto local_state = LocalStateType::create_unique(state, this);
531
69.6k
    RETURN_IF_ERROR(local_state->init(state, info));
532
69.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
69.6k
    return Status::OK();
534
69.6k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
16
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
16
    auto local_state = LocalStateType::create_unique(state, this);
531
16
    RETURN_IF_ERROR(local_state->init(state, info));
532
16
    state->emplace_local_state(operator_id(), std::move(local_state));
533
16
    return Status::OK();
534
16
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.74k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.74k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.74k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.74k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.74k
    return Status::OK();
534
3.74k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
268k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
268k
    auto local_state = LocalStateType::create_unique(state, this);
531
268k
    RETURN_IF_ERROR(local_state->init(state, info));
532
268k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
268k
    return Status::OK();
534
268k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.43k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.43k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.43k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.43k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.43k
    return Status::OK();
534
1.43k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.66k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.66k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.66k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.66k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.66k
    return Status::OK();
534
5.66k
}
_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
55.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
55.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
55.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
55.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
55.0k
    return Status::OK();
534
55.0k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.87k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.87k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.87k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.87k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.87k
    return Status::OK();
534
4.87k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
354
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
354
    auto local_state = LocalStateType::create_unique(state, this);
531
354
    RETURN_IF_ERROR(local_state->init(state, info));
532
354
    state->emplace_local_state(operator_id(), std::move(local_state));
533
354
    return Status::OK();
534
354
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.69k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.69k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.69k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.69k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.69k
    return Status::OK();
534
2.69k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.58k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.58k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.58k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.58k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.58k
    return Status::OK();
534
2.58k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_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_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.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.2k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.2k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.2k
    return Status::OK();
534
10.2k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
594k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
594k
    auto local_state = LocalStateType::create_unique(state, this);
531
594k
    RETURN_IF_ERROR(local_state->init(state, info));
532
594k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
594k
    return Status::OK();
534
594k
}
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.21k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.21k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.21k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.21k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.21k
    return Status::OK();
534
2.21k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
783
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
783
    auto local_state = LocalStateType::create_unique(state, this);
531
783
    RETURN_IF_ERROR(local_state->init(state, info));
532
783
    state->emplace_local_state(operator_id(), std::move(local_state));
533
783
    return Status::OK();
534
783
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
899
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
899
    auto local_state = LocalStateType::create_unique(state, this);
531
899
    RETURN_IF_ERROR(local_state->init(state, info));
532
899
    state->emplace_local_state(operator_id(), std::move(local_state));
533
899
    return Status::OK();
534
899
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.48k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.48k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.48k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.48k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.48k
    return Status::OK();
534
6.48k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
260k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
260k
    auto local_state = LocalStateType::create_unique(state, this);
531
260k
    RETURN_IF_ERROR(local_state->init(state, info));
532
260k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
260k
    return Status::OK();
534
260k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.63M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.90M
        : _num_rows_returned(0),
542
1.90M
          _rows_returned_counter(nullptr),
543
1.90M
          _parent(parent),
544
1.90M
          _state(state),
545
1.90M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.92M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.92M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.92M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.92M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.92M
    _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.92M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.92M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.92M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.92M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.92M
    if constexpr (!is_fake_shared) {
560
1.11M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
674k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
674k
                                    .first.get()
563
674k
                                    ->template cast<SharedStateArg>();
564
565
674k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
674k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
674k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
674k
        } else if (info.shared_state) {
569
375k
            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
375k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
375k
            _dependency = _shared_state->create_source_dependency(
576
375k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
375k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
375k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
375k
        } else {
580
65.7k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
5.48k
                DCHECK(false);
582
5.48k
            }
583
65.7k
        }
584
1.11M
    }
585
586
1.92M
    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.92M
    _rows_returned_counter =
591
1.92M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.92M
    _blocks_returned_counter =
593
1.92M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.92M
    _output_block_bytes_counter =
595
1.92M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.92M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.92M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.92M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.92M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.92M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.92M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.92M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.92M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.92M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.92M
    _memory_used_counter =
606
1.92M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.92M
    _common_profile->add_info_string("IsColocate",
608
1.92M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.92M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.92M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.92M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.92M
    return Status::OK();
613
1.92M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
71.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
71.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
71.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
71.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
71.2k
    _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
71.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
71.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
71.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
71.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
71.2k
    if constexpr (!is_fake_shared) {
560
71.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
13.4k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
13.4k
                                    .first.get()
563
13.4k
                                    ->template cast<SharedStateArg>();
564
565
13.4k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
13.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
13.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
57.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
57.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
57.0k
            _dependency = _shared_state->create_source_dependency(
576
57.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
57.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
57.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
57.0k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
720
        }
584
71.2k
    }
585
586
71.2k
    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
71.2k
    _rows_returned_counter =
591
71.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
71.2k
    _blocks_returned_counter =
593
71.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
71.2k
    _output_block_bytes_counter =
595
71.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
71.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
71.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
71.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
71.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
71.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
71.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
71.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
71.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
71.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
71.2k
    _memory_used_counter =
606
71.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
71.2k
    _common_profile->add_info_string("IsColocate",
608
71.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
71.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
71.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
71.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
71.2k
    return Status::OK();
613
71.2k
}
_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
203k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
203k
            _dependency = _shared_state->create_source_dependency(
576
203k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
203k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
203k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
203k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
7.83k
        }
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
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_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.67k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.67k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.67k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.67k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.67k
    _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.67k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.67k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.67k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.67k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.67k
    if constexpr (!is_fake_shared) {
560
5.67k
        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.67k
        } 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.65k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.65k
            _dependency = _shared_state->create_source_dependency(
576
5.65k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.65k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.65k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.65k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
24
        }
584
5.67k
    }
585
586
5.67k
    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.67k
    _rows_returned_counter =
591
5.67k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.67k
    _blocks_returned_counter =
593
5.67k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.67k
    _output_block_bytes_counter =
595
5.67k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.67k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.67k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.67k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.67k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.67k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.67k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.67k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.67k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.67k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.67k
    _memory_used_counter =
606
5.67k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.67k
    _common_profile->add_info_string("IsColocate",
608
5.67k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.67k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.67k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.67k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.67k
    return Status::OK();
613
5.67k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
9.32k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
9.32k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
9.32k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
9.32k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
9.32k
    _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
9.32k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
9.32k
    _operator_profile->add_child(_common_profile.get(), true);
557
9.32k
    _operator_profile->add_child(_custom_profile.get(), true);
558
9.32k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
9.32k
    if constexpr (!is_fake_shared) {
560
9.32k
        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
9.32k
        } 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
9.24k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
9.24k
            _dependency = _shared_state->create_source_dependency(
576
9.24k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
9.24k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
9.24k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
9.24k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
79
        }
584
9.32k
    }
585
586
9.32k
    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
9.32k
    _rows_returned_counter =
591
9.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
9.32k
    _blocks_returned_counter =
593
9.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
9.32k
    _output_block_bytes_counter =
595
9.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
9.32k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
9.32k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
9.32k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
9.32k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
9.32k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
9.32k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
9.32k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
9.32k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
9.32k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
9.32k
    _memory_used_counter =
606
9.32k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
9.32k
    _common_profile->add_info_string("IsColocate",
608
9.32k
                                     std::to_string(_parent->is_colocated_operator()));
609
9.32k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
9.32k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
9.32k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
9.32k
    return Status::OK();
613
9.32k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
85.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
85.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
85.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
85.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
85.2k
    _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
85.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
85.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
85.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
85.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
85.2k
    if constexpr (!is_fake_shared) {
560
85.2k
        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
85.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
84.2k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
84.2k
            _dependency = _shared_state->create_source_dependency(
576
84.2k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
84.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
84.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
84.2k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.03k
        }
584
85.2k
    }
585
586
85.2k
    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
85.2k
    _rows_returned_counter =
591
85.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
85.2k
    _blocks_returned_counter =
593
85.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
85.2k
    _output_block_bytes_counter =
595
85.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
85.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
85.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
85.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
85.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
85.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
85.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
85.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
85.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
85.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
85.2k
    _memory_used_counter =
606
85.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
85.2k
    _common_profile->add_info_string("IsColocate",
608
85.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
85.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
85.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
85.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
85.2k
    return Status::OK();
613
85.2k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
69.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
69.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
69.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
69.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
69.6k
    _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
69.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
69.6k
    _operator_profile->add_child(_common_profile.get(), true);
557
69.6k
    _operator_profile->add_child(_custom_profile.get(), true);
558
69.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
69.6k
    if constexpr (!is_fake_shared) {
560
69.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
69.6k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
69.6k
                                    .first.get()
563
69.6k
                                    ->template cast<SharedStateArg>();
564
565
69.6k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
69.6k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
69.6k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
69.6k
    }
585
586
69.6k
    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
69.6k
    _rows_returned_counter =
591
69.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
69.6k
    _blocks_returned_counter =
593
69.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
69.6k
    _output_block_bytes_counter =
595
69.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
69.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
69.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
69.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
69.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
69.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
69.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
69.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
69.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
69.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
69.6k
    _memory_used_counter =
606
69.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
69.6k
    _common_profile->add_info_string("IsColocate",
608
69.6k
                                     std::to_string(_parent->is_colocated_operator()));
609
69.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
69.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
69.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
69.6k
    return Status::OK();
613
69.6k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
16
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
16
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
16
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
16
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
16
    _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
16
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
16
    _operator_profile->add_child(_common_profile.get(), true);
557
16
    _operator_profile->add_child(_custom_profile.get(), true);
558
16
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
16
    if constexpr (!is_fake_shared) {
560
16
        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
16
        } 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
16
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
16
            _dependency = _shared_state->create_source_dependency(
576
16
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
16
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
16
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
16
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
16
    }
585
586
16
    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
16
    _rows_returned_counter =
591
16
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
16
    _blocks_returned_counter =
593
16
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
16
    _output_block_bytes_counter =
595
16
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
16
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
16
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
16
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
16
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
16
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
16
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
16
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
16
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
16
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
16
    _memory_used_counter =
606
16
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
16
    _common_profile->add_info_string("IsColocate",
608
16
                                     std::to_string(_parent->is_colocated_operator()));
609
16
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
16
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
16
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
16
    return Status::OK();
613
16
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
804k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
804k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
804k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
804k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
804k
    _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
804k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
804k
    _operator_profile->add_child(_common_profile.get(), true);
557
804k
    _operator_profile->add_child(_custom_profile.get(), true);
558
804k
    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
804k
    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
804k
    _rows_returned_counter =
591
804k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
804k
    _blocks_returned_counter =
593
804k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
804k
    _output_block_bytes_counter =
595
804k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
804k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
804k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
804k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
804k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
804k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
804k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
804k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
804k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
804k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
804k
    _memory_used_counter =
606
804k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
804k
    _common_profile->add_info_string("IsColocate",
608
804k
                                     std::to_string(_parent->is_colocated_operator()));
609
804k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
804k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
804k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
804k
    return Status::OK();
613
804k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
55.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
55.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
55.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
55.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
55.0k
    _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
55.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
55.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
55.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
55.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
55.0k
    if constexpr (!is_fake_shared) {
560
55.0k
        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
55.0k
        } 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.44k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.44k
            _dependency = _shared_state->create_source_dependency(
576
4.44k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.44k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.44k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.6k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
50.6k
        }
584
55.0k
    }
585
586
55.0k
    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
55.0k
    _rows_returned_counter =
591
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
55.0k
    _blocks_returned_counter =
593
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
55.0k
    _output_block_bytes_counter =
595
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
55.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
55.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
55.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
55.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
55.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
55.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
55.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
55.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
55.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
55.0k
    _memory_used_counter =
606
55.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
55.0k
    _common_profile->add_info_string("IsColocate",
608
55.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
55.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
55.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
55.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
55.0k
    return Status::OK();
613
55.0k
}
_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.88k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
4.88k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
4.88k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
4.88k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
4.88k
    _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.88k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
4.88k
    _operator_profile->add_child(_common_profile.get(), true);
557
4.88k
    _operator_profile->add_child(_custom_profile.get(), true);
558
4.88k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
4.88k
    if constexpr (!is_fake_shared) {
560
4.88k
        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.88k
        } 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.86k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.86k
            _dependency = _shared_state->create_source_dependency(
576
4.86k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.86k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.86k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.86k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
21
        }
584
4.88k
    }
585
586
4.88k
    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.88k
    _rows_returned_counter =
591
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
4.88k
    _blocks_returned_counter =
593
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
4.88k
    _output_block_bytes_counter =
595
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
4.88k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
4.88k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
4.88k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
4.88k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
4.88k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
4.88k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
4.88k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
4.88k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
4.88k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
4.88k
    _memory_used_counter =
606
4.88k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
4.88k
    _common_profile->add_info_string("IsColocate",
608
4.88k
                                     std::to_string(_parent->is_colocated_operator()));
609
4.88k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
4.88k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
4.88k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
4.88k
    return Status::OK();
613
4.88k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
458
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
458
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
458
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
458
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
458
    _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
458
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
458
    _operator_profile->add_child(_common_profile.get(), true);
557
458
    _operator_profile->add_child(_custom_profile.get(), true);
558
458
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
458
    if constexpr (!is_fake_shared) {
560
458
        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
458
        } 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
454
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
454
            _dependency = _shared_state->create_source_dependency(
576
454
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
454
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
454
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
454
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
4
        }
584
458
    }
585
586
458
    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
458
    _rows_returned_counter =
591
458
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
458
    _blocks_returned_counter =
593
458
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
458
    _output_block_bytes_counter =
595
458
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
458
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
458
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
458
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
458
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
458
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
458
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
458
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
458
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
458
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
458
    _memory_used_counter =
606
458
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
458
    _common_profile->add_info_string("IsColocate",
608
458
                                     std::to_string(_parent->is_colocated_operator()));
609
458
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
458
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
458
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
458
    return Status::OK();
613
458
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.29k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.29k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.29k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.29k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.29k
    _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.29k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.29k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.29k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.29k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.29k
    if constexpr (!is_fake_shared) {
560
5.29k
        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.29k
        } 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.26k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.26k
            _dependency = _shared_state->create_source_dependency(
576
5.26k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.26k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.26k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.26k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
31
        }
584
5.29k
    }
585
586
5.29k
    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.29k
    _rows_returned_counter =
591
5.29k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.29k
    _blocks_returned_counter =
593
5.29k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.29k
    _output_block_bytes_counter =
595
5.29k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.29k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.29k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.29k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.29k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.29k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.29k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.29k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.29k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.29k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.29k
    _memory_used_counter =
606
5.29k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.29k
    _common_profile->add_info_string("IsColocate",
608
5.29k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.29k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.29k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.29k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.29k
    return Status::OK();
613
5.29k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
596k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
596k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
596k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
596k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
596k
    _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
596k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
596k
    _operator_profile->add_child(_common_profile.get(), true);
557
596k
    _operator_profile->add_child(_custom_profile.get(), true);
558
596k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
596k
    if constexpr (!is_fake_shared) {
560
596k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
591k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
591k
                                    .first.get()
563
591k
                                    ->template cast<SharedStateArg>();
564
565
591k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
591k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
591k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
591k
        } 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
5.48k
        } else {
580
5.48k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
5.48k
                DCHECK(false);
582
5.48k
            }
583
5.48k
        }
584
596k
    }
585
586
596k
    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
596k
    _rows_returned_counter =
591
596k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
596k
    _blocks_returned_counter =
593
596k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
596k
    _output_block_bytes_counter =
595
596k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
596k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
596k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
596k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
596k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
596k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
596k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
596k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
596k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
596k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
596k
    _memory_used_counter =
606
596k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
596k
    _common_profile->add_info_string("IsColocate",
608
596k
                                     std::to_string(_parent->is_colocated_operator()));
609
596k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
596k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
596k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
596k
    return Status::OK();
613
596k
}
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.93M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.93M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.23M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
305k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
305k
    }
621
1.93M
    if (_parent->has_projection()) {
622
382k
        const auto& projection = *_parent->_projection;
623
382k
        _projections.resize(projection.projections.size());
624
2.37M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.98M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.98M
        }
627
382k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
396k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
14.3k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
201k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
186k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
186k
                        state, _intermediate_projections[i][j]));
633
186k
            }
634
14.3k
        }
635
382k
    }
636
1.93M
    return Status::OK();
637
1.93M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
71.5k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
71.5k
    _conjuncts.resize(_parent->_conjuncts.size());
618
72.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.36k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.36k
    }
621
71.5k
    if (_parent->has_projection()) {
622
71.5k
        const auto& projection = *_parent->_projection;
623
71.5k
        _projections.resize(projection.projections.size());
624
388k
        for (size_t i = 0; i < _projections.size(); i++) {
625
316k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
316k
        }
627
71.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
78.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.91k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
153k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
146k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
146k
                        state, _intermediate_projections[i][j]));
633
146k
            }
634
6.91k
        }
635
71.5k
    }
636
71.5k
    return Status::OK();
637
71.5k
}
_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
79
        const auto& projection = *_parent->_projection;
623
79
        _projections.resize(projection.projections.size());
624
400
        for (size_t i = 0; i < _projections.size(); i++) {
625
321
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
321
        }
627
79
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
79
        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
79
    }
636
212k
    return Status::OK();
637
212k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
26
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
26
    _conjuncts.resize(_parent->_conjuncts.size());
618
26
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
26
    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
26
    return Status::OK();
637
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.67k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.67k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.70k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
27
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
27
    }
621
5.68k
    if (_parent->has_projection()) {
622
5.68k
        const auto& projection = *_parent->_projection;
623
5.68k
        _projections.resize(projection.projections.size());
624
25.4k
        for (size_t i = 0; i < _projections.size(); i++) {
625
19.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
19.7k
        }
627
5.68k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.70k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
16
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
128
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
112
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
112
                        state, _intermediate_projections[i][j]));
633
112
            }
634
16
        }
635
5.68k
    }
636
5.67k
    return Status::OK();
637
5.67k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
9.34k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
9.34k
    _conjuncts.resize(_parent->_conjuncts.size());
618
10.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
928
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
928
    }
621
9.34k
    if (_parent->has_projection()) {
622
5.24k
        const auto& projection = *_parent->_projection;
623
5.24k
        _projections.resize(projection.projections.size());
624
22.3k
        for (size_t i = 0; i < _projections.size(); i++) {
625
17.1k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
17.1k
        }
627
5.24k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.33k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
89
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
673
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
584
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
584
                        state, _intermediate_projections[i][j]));
633
584
            }
634
89
        }
635
5.24k
    }
636
9.34k
    return Status::OK();
637
9.34k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
85.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
85.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
87.7k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
2.12k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
2.12k
    }
621
85.6k
    if (_parent->has_projection()) {
622
28.7k
        const auto& projection = *_parent->_projection;
623
28.7k
        _projections.resize(projection.projections.size());
624
267k
        for (size_t i = 0; i < _projections.size(); i++) {
625
238k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
238k
        }
627
28.7k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
28.8k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
149
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
884
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
735
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
735
                        state, _intermediate_projections[i][j]));
633
735
            }
634
149
        }
635
28.7k
    }
636
85.6k
    return Status::OK();
637
85.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
69.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
69.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
69.7k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
21
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
21
    }
621
69.6k
    if (_parent->has_projection()) {
622
152
        const auto& projection = *_parent->_projection;
623
152
        _projections.resize(projection.projections.size());
624
953
        for (size_t i = 0; i < _projections.size(); i++) {
625
801
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
801
        }
627
152
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
153
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
1
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
10
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
10
                        state, _intermediate_projections[i][j]));
633
10
            }
634
1
        }
635
152
    }
636
69.6k
    return Status::OK();
637
69.6k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
20
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
20
    _conjuncts.resize(_parent->_conjuncts.size());
618
20
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
20
    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
20
    return Status::OK();
637
20
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
810k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
810k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.11M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
300k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
300k
    }
621
810k
    if (_parent->has_projection()) {
622
259k
        const auto& projection = *_parent->_projection;
623
259k
        _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
259k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
266k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.99k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
42.3k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
35.3k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
35.3k
                        state, _intermediate_projections[i][j]));
633
35.3k
            }
634
6.99k
        }
635
259k
    }
636
810k
    return Status::OK();
637
810k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
55.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
55.2k
    _conjuncts.resize(_parent->_conjuncts.size());
618
55.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
55.2k
    if (_parent->has_projection()) {
622
11.4k
        const auto& projection = *_parent->_projection;
623
11.4k
        _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.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
163
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3.64k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3.48k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3.48k
                        state, _intermediate_projections[i][j]));
633
3.48k
            }
634
163
        }
635
11.4k
    }
636
55.2k
    return Status::OK();
637
55.2k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
4.87k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
4.87k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.29k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
417
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
417
    }
621
4.87k
    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.87k
    return Status::OK();
637
4.87k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
458
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
458
    _conjuncts.resize(_parent->_conjuncts.size());
618
458
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
458
    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
458
    return Status::OK();
637
458
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.29k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.29k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.29k
    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.29k
    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.29k
    return Status::OK();
637
5.29k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
601k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
601k
    _conjuncts.resize(_parent->_conjuncts.size());
618
601k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
601k
    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
601k
    return Status::OK();
637
601k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
168
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
168
    _conjuncts.resize(_parent->_conjuncts.size());
618
175
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
168
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
490
        for (size_t i = 0; i < _projections.size(); i++) {
625
324
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
324
        }
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
168
    return Status::OK();
637
168
}
638
639
template <typename SharedStateArg>
640
9.27k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
9.27k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
9.27k
    _terminated = true;
645
9.27k
    return Status::OK();
646
9.27k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
429
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
429
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
429
    _terminated = true;
645
429
    return Status::OK();
646
429
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
22
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
22
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
22
    _terminated = true;
645
22
    return Status::OK();
646
22
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
52
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
52
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
52
    _terminated = true;
645
52
    return Status::OK();
646
52
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
51
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
51
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
51
    _terminated = true;
645
51
    return Status::OK();
646
51
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_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
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
7.22k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.22k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7.22k
    _terminated = true;
645
7.22k
    return Status::OK();
646
7.22k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
67
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
67
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
67
    _terminated = true;
645
67
    return Status::OK();
646
67
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
7
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7
    _terminated = true;
645
7
    return Status::OK();
646
7
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
11
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
11
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
11
    _terminated = true;
645
11
    return Status::OK();
646
11
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.38k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.38k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1.38k
    _terminated = true;
645
1.38k
    return Status::OK();
646
1.38k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
30
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
30
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
30
    _terminated = true;
645
30
    return Status::OK();
646
30
}
647
648
template <typename SharedStateArg>
649
2.17M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.17M
    if (_closed) {
651
242k
        return Status::OK();
652
242k
    }
653
1.93M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.11M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.11M
    }
656
1.93M
    _closed = true;
657
1.93M
    return Status::OK();
658
2.17M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
71.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
71.4k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
71.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
71.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
71.4k
    }
656
71.4k
    _closed = true;
657
71.4k
    return Status::OK();
658
71.4k
}
_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
211k
        return Status::OK();
652
211k
    }
653
209k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
209k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
209k
    }
656
209k
    _closed = true;
657
209k
    return Status::OK();
658
421k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
26
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
26
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
26
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
26
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
26
    }
656
26
    _closed = true;
657
26
    return Status::OK();
658
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.67k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.67k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.67k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.67k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.67k
    }
656
5.67k
    _closed = true;
657
5.67k
    return Status::OK();
658
5.67k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
18.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
18.8k
    if (_closed) {
651
9.53k
        return Status::OK();
652
9.53k
    }
653
9.32k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
9.32k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
9.32k
    }
656
9.32k
    _closed = true;
657
9.32k
    return Status::OK();
658
18.8k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
85.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
85.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
85.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
85.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
85.5k
    }
656
85.5k
    _closed = true;
657
85.5k
    return Status::OK();
658
85.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
69.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
69.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
69.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
69.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
69.2k
    }
656
69.2k
    _closed = true;
657
69.2k
    return Status::OK();
658
69.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
15
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
15
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
15
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
15
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
15
    }
656
15
    _closed = true;
657
15
    return Status::OK();
658
15
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
826k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
826k
    if (_closed) {
651
15.4k
        return Status::OK();
652
15.4k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
811k
    _closed = true;
657
811k
    return Status::OK();
658
826k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
55.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
55.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
55.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
55.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
55.2k
    }
656
55.2k
    _closed = true;
657
55.2k
    return Status::OK();
658
55.2k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4.85k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4.85k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4.85k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4.85k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4.85k
    }
656
4.85k
    _closed = true;
657
4.85k
    return Status::OK();
658
4.85k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
711
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
711
    if (_closed) {
651
356
        return Status::OK();
652
356
    }
653
355
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
355
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
355
    }
656
355
    _closed = true;
657
355
    return Status::OK();
658
711
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
11.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
11.0k
    if (_closed) {
651
5.72k
        return Status::OK();
652
5.72k
    }
653
5.27k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.27k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.27k
    }
656
5.27k
    _closed = true;
657
5.27k
    return Status::OK();
658
11.0k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
602k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
602k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
602k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
602k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
602k
    }
656
602k
    _closed = true;
657
602k
    return Status::OK();
658
602k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
337
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
337
    if (_closed) {
651
177
        return Status::OK();
652
177
    }
653
160
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
160
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
160
    }
656
160
    _closed = true;
657
160
    return Status::OK();
658
337
}
659
660
template <typename SharedState>
661
1.64M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.64M
    _operator_profile =
664
1.64M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.64M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.64M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
1.64M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.64M
    _operator_profile->add_child(_common_profile, true);
673
1.64M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.64M
    _operator_profile->set_metadata(_parent->node_id());
676
1.64M
    _wait_for_finish_dependency_timer =
677
1.64M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.64M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.64M
    if constexpr (!is_fake_shared) {
680
1.16M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.16M
            info.shared_state_map.end()) {
682
317k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
234k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
234k
            }
685
317k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
317k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
317k
                                                  ? 0
688
317k
                                                  : info.task_idx]
689
317k
                                  .get();
690
317k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
843k
        } else {
692
843k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
96
                DCHECK(false);
694
96
            }
695
843k
            _shared_state = info.shared_state->template cast<SharedState>();
696
843k
            _dependency = _shared_state->create_sink_dependency(
697
843k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
843k
        }
699
1.16M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.16M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.16M
    }
702
703
1.64M
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
1.64M
    _rows_input_counter =
708
1.64M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.64M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.64M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.64M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.64M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.64M
    _memory_used_counter =
714
1.64M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.64M
    _common_profile->add_info_string("IsColocate",
716
1.64M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.64M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.64M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.64M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.64M
    return Status::OK();
721
1.64M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
119k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
119k
    _operator_profile =
664
119k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
119k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
119k
    _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
119k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
119k
    _operator_profile->add_child(_common_profile, true);
673
119k
    _operator_profile->add_child(_custom_profile, true);
674
675
119k
    _operator_profile->set_metadata(_parent->node_id());
676
119k
    _wait_for_finish_dependency_timer =
677
119k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
119k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
119k
    if constexpr (!is_fake_shared) {
680
119k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
119k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
13.7k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
13.7k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
13.7k
                                                  ? 0
688
13.7k
                                                  : info.task_idx]
689
13.7k
                                  .get();
690
13.7k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
105k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
105k
            _shared_state = info.shared_state->template cast<SharedState>();
696
105k
            _dependency = _shared_state->create_sink_dependency(
697
105k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
105k
        }
699
119k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
119k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
119k
    }
702
703
119k
    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
119k
    _rows_input_counter =
708
119k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
119k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
119k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
119k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
119k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
119k
    _memory_used_counter =
714
119k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
119k
    _common_profile->add_info_string("IsColocate",
716
119k
                                     std::to_string(_parent->is_colocated_operator()));
717
119k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
119k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
119k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
119k
    return Status::OK();
721
119k
}
_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
212k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
212k
    _operator_profile =
664
212k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
212k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
212k
    _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
212k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
212k
    _operator_profile->add_child(_common_profile, true);
673
212k
    _operator_profile->add_child(_custom_profile, true);
674
675
212k
    _operator_profile->set_metadata(_parent->node_id());
676
212k
    _wait_for_finish_dependency_timer =
677
212k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
212k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
212k
    if constexpr (!is_fake_shared) {
680
212k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
212k
            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
212k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
212k
            _shared_state = info.shared_state->template cast<SharedState>();
696
212k
            _dependency = _shared_state->create_sink_dependency(
697
212k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
212k
        }
699
212k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
212k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
212k
    }
702
703
212k
    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
212k
    _rows_input_counter =
708
212k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
212k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
212k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
212k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
212k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
212k
    _memory_used_counter =
714
212k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
212k
    _common_profile->add_info_string("IsColocate",
716
212k
                                     std::to_string(_parent->is_colocated_operator()));
717
212k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
212k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
212k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
212k
    return Status::OK();
721
212k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
33
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
33
    _operator_profile =
664
33
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
33
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
33
    _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
33
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
33
    _operator_profile->add_child(_common_profile, true);
673
33
    _operator_profile->add_child(_custom_profile, true);
674
675
33
    _operator_profile->set_metadata(_parent->node_id());
676
33
    _wait_for_finish_dependency_timer =
677
33
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
33
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
33
    if constexpr (!is_fake_shared) {
680
33
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
33
            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
33
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
33
            _shared_state = info.shared_state->template cast<SharedState>();
696
33
            _dependency = _shared_state->create_sink_dependency(
697
33
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
33
        }
699
33
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
33
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
33
    }
702
703
33
    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
33
    _rows_input_counter =
708
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
33
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
33
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
33
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
33
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
33
    _memory_used_counter =
714
33
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
33
    _common_profile->add_info_string("IsColocate",
716
33
                                     std::to_string(_parent->is_colocated_operator()));
717
33
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
33
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
33
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
33
    return Status::OK();
721
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.68k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.68k
    _operator_profile =
664
5.68k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.68k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.68k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
5.68k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.68k
    _operator_profile->add_child(_common_profile, true);
673
5.68k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.68k
    _operator_profile->set_metadata(_parent->node_id());
676
5.68k
    _wait_for_finish_dependency_timer =
677
5.68k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.68k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.68k
    if constexpr (!is_fake_shared) {
680
5.68k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.68k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
5.68k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.68k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.68k
            _dependency = _shared_state->create_sink_dependency(
697
5.68k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.68k
        }
699
5.68k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.68k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.68k
    }
702
703
5.68k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
5.68k
    _rows_input_counter =
708
5.68k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.68k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.68k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.68k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.68k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.68k
    _memory_used_counter =
714
5.68k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.68k
    _common_profile->add_info_string("IsColocate",
716
5.68k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.68k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.68k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.68k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.68k
    return Status::OK();
721
5.68k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
9.32k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
9.32k
    _operator_profile =
664
9.32k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
9.32k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
9.32k
    _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
9.32k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
9.32k
    _operator_profile->add_child(_common_profile, true);
673
9.32k
    _operator_profile->add_child(_custom_profile, true);
674
675
9.32k
    _operator_profile->set_metadata(_parent->node_id());
676
9.32k
    _wait_for_finish_dependency_timer =
677
9.32k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
9.32k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
9.32k
    if constexpr (!is_fake_shared) {
680
9.32k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
9.32k
            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
9.32k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
9.32k
            _shared_state = info.shared_state->template cast<SharedState>();
696
9.32k
            _dependency = _shared_state->create_sink_dependency(
697
9.32k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
9.32k
        }
699
9.32k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
9.32k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
9.32k
    }
702
703
9.32k
    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
9.32k
    _rows_input_counter =
708
9.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
9.32k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
9.32k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
9.32k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
9.32k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
9.32k
    _memory_used_counter =
714
9.32k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
9.32k
    _common_profile->add_info_string("IsColocate",
716
9.32k
                                     std::to_string(_parent->is_colocated_operator()));
717
9.32k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
9.32k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
9.32k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
9.32k
    return Status::OK();
721
9.32k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
85.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
85.4k
    _operator_profile =
664
85.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
85.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
85.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
85.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
85.4k
    _operator_profile->add_child(_common_profile, true);
673
85.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
85.4k
    _operator_profile->set_metadata(_parent->node_id());
676
85.4k
    _wait_for_finish_dependency_timer =
677
85.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
85.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
85.4k
    if constexpr (!is_fake_shared) {
680
85.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
85.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
85.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
85.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
85.4k
            _dependency = _shared_state->create_sink_dependency(
697
85.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
85.4k
        }
699
85.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
85.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
85.4k
    }
702
703
85.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
85.4k
    _rows_input_counter =
708
85.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
85.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
85.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
85.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
85.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
85.4k
    _memory_used_counter =
714
85.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
85.4k
    _common_profile->add_info_string("IsColocate",
716
85.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
85.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
85.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
85.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
85.4k
    return Status::OK();
721
85.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
69.6k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
69.6k
    _operator_profile =
664
69.6k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
69.6k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
69.6k
    _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
69.6k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
69.6k
    _operator_profile->add_child(_common_profile, true);
673
69.6k
    _operator_profile->add_child(_custom_profile, true);
674
675
69.6k
    _operator_profile->set_metadata(_parent->node_id());
676
69.6k
    _wait_for_finish_dependency_timer =
677
69.6k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
69.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
69.6k
    if constexpr (!is_fake_shared) {
680
69.6k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
69.6k
            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
69.6k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
69.6k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
69.6k
                                                  ? 0
688
69.6k
                                                  : info.task_idx]
689
69.6k
                                  .get();
690
69.6k
            _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
69.6k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
69.6k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
69.6k
    }
702
703
69.6k
    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
69.6k
    _rows_input_counter =
708
69.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
69.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
69.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
69.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
69.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
69.6k
    _memory_used_counter =
714
69.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
69.6k
    _common_profile->add_info_string("IsColocate",
716
69.6k
                                     std::to_string(_parent->is_colocated_operator()));
717
69.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
69.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
69.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
69.6k
    return Status::OK();
721
69.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
26
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
26
    _operator_profile =
664
26
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
26
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
26
    _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
26
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
26
    _operator_profile->add_child(_common_profile, true);
673
26
    _operator_profile->add_child(_custom_profile, true);
674
675
26
    _operator_profile->set_metadata(_parent->node_id());
676
26
    _wait_for_finish_dependency_timer =
677
26
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
26
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
26
    if constexpr (!is_fake_shared) {
680
26
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
26
            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
26
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
26
            _shared_state = info.shared_state->template cast<SharedState>();
696
26
            _dependency = _shared_state->create_sink_dependency(
697
26
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
26
        }
699
26
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
26
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
26
    }
702
703
26
    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
26
    _rows_input_counter =
708
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
26
    _memory_used_counter =
714
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
26
    _common_profile->add_info_string("IsColocate",
716
26
                                     std::to_string(_parent->is_colocated_operator()));
717
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
26
    return Status::OK();
721
26
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
481k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
481k
    _operator_profile =
664
481k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
481k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
481k
    _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
481k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
481k
    _operator_profile->add_child(_common_profile, true);
673
481k
    _operator_profile->add_child(_custom_profile, true);
674
675
481k
    _operator_profile->set_metadata(_parent->node_id());
676
481k
    _wait_for_finish_dependency_timer =
677
481k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
481k
    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
481k
    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
481k
    _rows_input_counter =
708
481k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
481k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
481k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
481k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
481k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
481k
    _memory_used_counter =
714
481k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
481k
    _common_profile->add_info_string("IsColocate",
716
481k
                                     std::to_string(_parent->is_colocated_operator()));
717
481k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
481k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
481k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
481k
    return Status::OK();
721
481k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
10.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
10.4k
    _operator_profile =
664
10.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
10.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
10.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
10.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
10.4k
    _operator_profile->add_child(_common_profile, true);
673
10.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
10.4k
    _operator_profile->set_metadata(_parent->node_id());
676
10.4k
    _wait_for_finish_dependency_timer =
677
10.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
10.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
10.4k
    if constexpr (!is_fake_shared) {
680
10.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
10.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
10.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
10.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
10.4k
            _dependency = _shared_state->create_sink_dependency(
697
10.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
10.4k
        }
699
10.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
10.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
10.4k
    }
702
703
10.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
10.4k
    _rows_input_counter =
708
10.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
10.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
10.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
10.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
10.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
10.4k
    _memory_used_counter =
714
10.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
10.4k
    _common_profile->add_info_string("IsColocate",
716
10.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
10.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
10.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
10.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
10.4k
    return Status::OK();
721
10.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
456
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
456
    _operator_profile =
664
456
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
456
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
456
    _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
456
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
456
    _operator_profile->add_child(_common_profile, true);
673
456
    _operator_profile->add_child(_custom_profile, true);
674
675
456
    _operator_profile->set_metadata(_parent->node_id());
676
456
    _wait_for_finish_dependency_timer =
677
456
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
456
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
456
    if constexpr (!is_fake_shared) {
680
456
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
456
            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
456
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
456
            _shared_state = info.shared_state->template cast<SharedState>();
696
456
            _dependency = _shared_state->create_sink_dependency(
697
456
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
456
        }
699
456
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
456
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
456
    }
702
703
456
    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
456
    _rows_input_counter =
708
456
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
456
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
456
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
456
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
456
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
456
    _memory_used_counter =
714
456
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
456
    _common_profile->add_info_string("IsColocate",
716
456
                                     std::to_string(_parent->is_colocated_operator()));
717
456
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
456
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
456
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
456
    return Status::OK();
721
456
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.11k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.11k
    _operator_profile =
664
2.11k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.11k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.11k
    _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.11k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.11k
    _operator_profile->add_child(_common_profile, true);
673
2.11k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.11k
    _operator_profile->set_metadata(_parent->node_id());
676
2.11k
    _wait_for_finish_dependency_timer =
677
2.11k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.11k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.11k
    if constexpr (!is_fake_shared) {
680
2.11k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.11k
            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.11k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.11k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.11k
            _dependency = _shared_state->create_sink_dependency(
697
2.11k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.11k
        }
699
2.11k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.11k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.11k
    }
702
703
2.11k
    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.11k
    _rows_input_counter =
708
2.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.11k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.11k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.11k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.11k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.11k
    _memory_used_counter =
714
2.11k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.11k
    _common_profile->add_info_string("IsColocate",
716
2.11k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.11k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.11k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.11k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.11k
    return Status::OK();
721
2.11k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.8k
    _operator_profile =
664
12.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.8k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.8k
    _operator_profile->add_child(_common_profile, true);
673
12.8k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.8k
    _operator_profile->set_metadata(_parent->node_id());
676
12.8k
    _wait_for_finish_dependency_timer =
677
12.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.8k
    if constexpr (!is_fake_shared) {
680
12.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.8k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.8k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.8k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.8k
            _dependency = _shared_state->create_sink_dependency(
697
12.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.8k
        }
699
12.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.8k
    }
702
703
12.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.8k
    _rows_input_counter =
708
12.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.8k
    _memory_used_counter =
714
12.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.8k
    _common_profile->add_info_string("IsColocate",
716
12.8k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.8k
    return Status::OK();
721
12.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
234k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
234k
    _operator_profile =
664
234k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
234k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
234k
    _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
234k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
234k
    _operator_profile->add_child(_common_profile, true);
673
234k
    _operator_profile->add_child(_custom_profile, true);
674
675
234k
    _operator_profile->set_metadata(_parent->node_id());
676
234k
    _wait_for_finish_dependency_timer =
677
234k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
234k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
234k
    if constexpr (!is_fake_shared) {
680
234k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
234k
            info.shared_state_map.end()) {
682
234k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
234k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
234k
            }
685
234k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
234k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
234k
                                                  ? 0
688
234k
                                                  : info.task_idx]
689
234k
                                  .get();
690
234k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
234k
        } else {
692
96
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
96
                DCHECK(false);
694
96
            }
695
96
            _shared_state = info.shared_state->template cast<SharedState>();
696
96
            _dependency = _shared_state->create_sink_dependency(
697
96
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
96
        }
699
234k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
234k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
234k
    }
702
703
234k
    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
234k
    _rows_input_counter =
708
234k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
234k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
234k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
234k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
234k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
234k
    _memory_used_counter =
714
234k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
234k
    _common_profile->add_info_string("IsColocate",
716
234k
                                     std::to_string(_parent->is_colocated_operator()));
717
234k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
234k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
234k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
234k
    return Status::OK();
721
234k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
399k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
399k
    _operator_profile =
664
399k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
399k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
399k
    _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
399k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
399k
    _operator_profile->add_child(_common_profile, true);
673
399k
    _operator_profile->add_child(_custom_profile, true);
674
675
399k
    _operator_profile->set_metadata(_parent->node_id());
676
399k
    _wait_for_finish_dependency_timer =
677
399k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
399k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
399k
    if constexpr (!is_fake_shared) {
680
399k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
399k
            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
399k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
399k
            _shared_state = info.shared_state->template cast<SharedState>();
696
399k
            _dependency = _shared_state->create_sink_dependency(
697
399k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
399k
        }
699
399k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
399k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
399k
    }
702
703
399k
    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
399k
    _rows_input_counter =
708
399k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
399k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
399k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
399k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
399k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
399k
    _memory_used_counter =
714
399k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
399k
    _common_profile->add_info_string("IsColocate",
716
399k
                                     std::to_string(_parent->is_colocated_operator()));
717
399k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
399k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
399k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
399k
    return Status::OK();
721
399k
}
_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.64M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.64M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.64M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.16M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.16M
    }
731
1.64M
    _closed = true;
732
1.64M
    return Status::OK();
733
1.64M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
119k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
119k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
119k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
119k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
119k
    }
731
119k
    _closed = true;
732
119k
    return Status::OK();
733
119k
}
_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
24
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
24
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
22
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
22
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
22
    }
731
22
    _closed = true;
732
22
    return Status::OK();
733
24
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.64k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.64k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.64k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.64k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.64k
    }
731
5.64k
    _closed = true;
732
5.64k
    return Status::OK();
733
5.64k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
9.30k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
9.30k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
9.30k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
9.30k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
9.30k
    }
731
9.30k
    _closed = true;
732
9.30k
    return Status::OK();
733
9.30k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
85.3k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
85.3k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
85.3k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
85.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
85.3k
    }
731
85.3k
    _closed = true;
732
85.3k
    return Status::OK();
733
85.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
69.2k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
69.2k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
69.2k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
69.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
69.2k
    }
731
69.2k
    _closed = true;
732
69.2k
    return Status::OK();
733
69.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_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_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
485k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
485k
    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
485k
    _closed = true;
732
485k
    return Status::OK();
733
485k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
10.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
10.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
10.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
10.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
10.4k
    }
731
10.4k
    _closed = true;
732
10.4k
    return Status::OK();
733
10.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
352
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
352
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
352
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
352
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
352
    }
731
352
    _closed = true;
732
352
    return Status::OK();
733
352
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.11k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.11k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.11k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.11k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.11k
    }
731
2.11k
    _closed = true;
732
2.11k
    return Status::OK();
733
2.11k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.8k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.8k
    }
731
12.8k
    _closed = true;
732
12.8k
    return Status::OK();
733
12.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
235k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
235k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
235k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
235k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
235k
    }
731
235k
    _closed = true;
732
235k
    return Status::OK();
733
235k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
400k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
400k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
400k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
400k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
400k
    }
731
400k
    _closed = true;
732
400k
    return Status::OK();
733
400k
}
_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.12k
                                                          bool* eos) {
738
3.12k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
3.11k
    return pull(state, block, eos);
740
3.12k
}
_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.08k
                                                          bool* eos) {
738
3.08k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
3.08k
    return pull(state, block, eos);
740
3.08k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
481k
                                                         bool* eos) {
745
481k
    auto& local_state = get_local_state(state);
746
481k
    if (need_more_input_data(state)) {
747
448k
        local_state._child_block->clear_column_data(
748
448k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
448k
                        .num_materialized_slots());
750
448k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
448k
                state, local_state._child_block.get(), &local_state._child_eos));
752
448k
        *eos = local_state._child_eos;
753
448k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
53.4k
            return Status::OK();
755
53.4k
        }
756
395k
        {
757
395k
            SCOPED_TIMER(local_state.exec_time_counter());
758
395k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
395k
        }
760
395k
    }
761
762
427k
    if (!need_more_input_data(state)) {
763
401k
        SCOPED_TIMER(local_state.exec_time_counter());
764
401k
        bool new_eos = false;
765
401k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
401k
        if (new_eos) {
767
326k
            *eos = true;
768
326k
        } else if (!need_more_input_data(state)) {
769
23.0k
            *eos = false;
770
23.0k
        }
771
401k
    }
772
427k
    return Status::OK();
773
427k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
133k
                                                         bool* eos) {
745
133k
    auto& local_state = get_local_state(state);
746
133k
    if (need_more_input_data(state)) {
747
113k
        local_state._child_block->clear_column_data(
748
113k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
113k
                        .num_materialized_slots());
750
113k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
113k
                state, local_state._child_block.get(), &local_state._child_eos));
752
113k
        *eos = local_state._child_eos;
753
113k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
31.3k
            return Status::OK();
755
31.3k
        }
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
102k
    if (!need_more_input_data(state)) {
763
102k
        SCOPED_TIMER(local_state.exec_time_counter());
764
102k
        bool new_eos = false;
765
102k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
102k
        if (new_eos) {
767
47.1k
            *eos = true;
768
55.1k
        } else if (!need_more_input_data(state)) {
769
9.92k
            *eos = false;
770
9.92k
        }
771
102k
    }
772
102k
    return Status::OK();
773
102k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.17k
                                                         bool* eos) {
745
4.17k
    auto& local_state = get_local_state(state);
746
4.17k
    if (need_more_input_data(state)) {
747
2.25k
        local_state._child_block->clear_column_data(
748
2.25k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.25k
                        .num_materialized_slots());
750
2.25k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.25k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.25k
        *eos = local_state._child_eos;
753
2.25k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
284
            return Status::OK();
755
284
        }
756
1.97k
        {
757
1.97k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.97k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.97k
        }
760
1.97k
    }
761
762
3.91k
    if (!need_more_input_data(state)) {
763
3.91k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.91k
        bool new_eos = false;
765
3.91k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.91k
        if (new_eos) {
767
1.44k
            *eos = true;
768
2.47k
        } else if (!need_more_input_data(state)) {
769
1.91k
            *eos = false;
770
1.91k
        }
771
3.91k
    }
772
3.88k
    return Status::OK();
773
3.88k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.88k
                                                         bool* eos) {
745
1.88k
    auto& local_state = get_local_state(state);
746
1.88k
    if (need_more_input_data(state)) {
747
1.88k
        local_state._child_block->clear_column_data(
748
1.88k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.88k
                        .num_materialized_slots());
750
1.88k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.88k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.88k
        *eos = local_state._child_eos;
753
1.88k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
774
            return Status::OK();
755
774
        }
756
1.11k
        {
757
1.11k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.11k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.11k
        }
760
1.11k
    }
761
762
1.11k
    if (!need_more_input_data(state)) {
763
1.11k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.11k
        bool new_eos = false;
765
1.11k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.11k
        if (new_eos) {
767
783
            *eos = true;
768
783
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.11k
    }
772
1.11k
    return Status::OK();
773
1.11k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
16.5k
                                                         bool* eos) {
745
16.5k
    auto& local_state = get_local_state(state);
746
16.5k
    if (need_more_input_data(state)) {
747
16.5k
        local_state._child_block->clear_column_data(
748
16.5k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
16.5k
                        .num_materialized_slots());
750
16.5k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
16.5k
                state, local_state._child_block.get(), &local_state._child_eos));
752
16.5k
        *eos = local_state._child_eos;
753
16.5k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
4.86k
            return Status::OK();
755
4.86k
        }
756
11.7k
        {
757
11.7k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.7k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.7k
        }
760
11.7k
    }
761
762
11.7k
    if (!need_more_input_data(state)) {
763
6.50k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.50k
        bool new_eos = false;
765
6.50k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.50k
        if (new_eos) {
767
6.45k
            *eos = true;
768
6.45k
        } else if (!need_more_input_data(state)) {
769
9
            *eos = false;
770
9
        }
771
6.50k
    }
772
11.7k
    return Status::OK();
773
11.7k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
297k
                                                         bool* eos) {
745
297k
    auto& local_state = get_local_state(state);
746
297k
    if (need_more_input_data(state)) {
747
297k
        local_state._child_block->clear_column_data(
748
297k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
297k
                        .num_materialized_slots());
750
297k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
297k
                state, local_state._child_block.get(), &local_state._child_eos));
752
297k
        *eos = local_state._child_eos;
753
297k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
14.6k
            return Status::OK();
755
14.6k
        }
756
283k
        {
757
283k
            SCOPED_TIMER(local_state.exec_time_counter());
758
283k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
283k
        }
760
283k
    }
761
762
282k
    if (!need_more_input_data(state)) {
763
262k
        SCOPED_TIMER(local_state.exec_time_counter());
764
262k
        bool new_eos = false;
765
262k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
262k
        if (new_eos) {
767
261k
            *eos = true;
768
261k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
262k
    }
772
282k
    return Status::OK();
773
282k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
21.1k
                                                         bool* eos) {
745
21.1k
    auto& local_state = get_local_state(state);
746
21.1k
    if (need_more_input_data(state)) {
747
10.3k
        local_state._child_block->clear_column_data(
748
10.3k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.3k
                        .num_materialized_slots());
750
10.3k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.3k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.3k
        *eos = local_state._child_eos;
753
10.3k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
628
            return Status::OK();
755
628
        }
756
9.70k
        {
757
9.70k
            SCOPED_TIMER(local_state.exec_time_counter());
758
9.70k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
9.70k
        }
760
9.70k
    }
761
762
20.4k
    if (!need_more_input_data(state)) {
763
19.8k
        SCOPED_TIMER(local_state.exec_time_counter());
764
19.8k
        bool new_eos = false;
765
19.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
19.8k
        if (new_eos) {
767
5.64k
            *eos = true;
768
14.1k
        } else if (!need_more_input_data(state)) {
769
10.7k
            *eos = false;
770
10.7k
        }
771
19.8k
    }
772
20.4k
    return Status::OK();
773
20.4k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
6.66k
                                                         bool* eos) {
745
6.66k
    auto& local_state = get_local_state(state);
746
6.66k
    if (need_more_input_data(state)) {
747
6.30k
        local_state._child_block->clear_column_data(
748
6.30k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.30k
                        .num_materialized_slots());
750
6.30k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.30k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.30k
        *eos = local_state._child_eos;
753
6.30k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
923
            return Status::OK();
755
923
        }
756
5.37k
        {
757
5.37k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.37k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.37k
        }
760
5.37k
    }
761
762
5.74k
    if (!need_more_input_data(state)) {
763
5.74k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.74k
        bool new_eos = false;
765
5.74k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.74k
        if (new_eos) {
767
3.72k
            *eos = true;
768
3.72k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
5.74k
    }
772
5.73k
    return Status::OK();
773
5.73k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
47.2k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.2k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.2k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.2k
                                                         "AsyncWriterDependency", true);
781
47.2k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.2k
                             _finish_dependency));
783
784
47.2k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.2k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.2k
    return Status::OK();
787
47.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
349
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
349
    RETURN_IF_ERROR(Base::init(state, info));
779
349
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
349
                                                         "AsyncWriterDependency", true);
781
349
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
349
                             _finish_dependency));
783
784
349
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
349
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
349
    return Status::OK();
787
349
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
46.9k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.9k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.9k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.9k
                                                         "AsyncWriterDependency", true);
781
46.9k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.9k
                             _finish_dependency));
783
784
46.9k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.9k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.9k
    return Status::OK();
787
46.9k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
47.6k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.6k
    RETURN_IF_ERROR(Base::open(state));
793
47.6k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
372k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
325k
        RETURN_IF_ERROR(
796
325k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
325k
    }
798
47.6k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.6k
    return Status::OK();
800
47.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
348
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
348
    RETURN_IF_ERROR(Base::open(state));
793
348
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.81k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.47k
        RETURN_IF_ERROR(
796
1.47k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.47k
    }
798
348
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
348
    return Status::OK();
800
348
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
47.3k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.3k
    RETURN_IF_ERROR(Base::open(state));
793
47.3k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
371k
    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.3k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.3k
    return Status::OK();
800
47.3k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
62.6k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.6k
    return _writer->sink(block, eos);
806
62.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.29k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.29k
    return _writer->sink(block, eos);
806
1.29k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
61.3k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.3k
    return _writer->sink(block, eos);
806
61.3k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
47.7k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.7k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.7k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.7k
    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.7k
    if (_writer) {
818
47.7k
        Status st = _writer->get_writer_status();
819
47.7k
        if (exec_status.ok()) {
820
47.7k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.7k
                                                       : Status::Cancelled("force close"));
822
47.7k
        } else {
823
77
            _writer->force_close(exec_status);
824
77
        }
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.7k
        RETURN_IF_ERROR(st);
829
47.7k
    }
830
47.6k
    return Base::close(state, exec_status);
831
47.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
337
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
337
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
337
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
337
    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
337
    if (_writer) {
818
337
        Status st = _writer->get_writer_status();
819
337
        if (exec_status.ok()) {
820
337
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
337
                                                       : Status::Cancelled("force close"));
822
337
        } 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
337
        RETURN_IF_ERROR(st);
829
337
    }
830
337
    return Base::close(state, exec_status);
831
337
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
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.3k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.3k
                                                       : Status::Cancelled("force close"));
822
47.3k
        } else {
823
77
            _writer->force_close(exec_status);
824
77
        }
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
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
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