Coverage Report

Created: 2026-07-29 15:21

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