Coverage Report

Created: 2026-06-26 04:46

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/operator/operator.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "exec/operator/operator.h"
19
20
#include <algorithm>
21
22
#include "common/status.h"
23
#include "exec/common/util.hpp"
24
#include "exec/exchange/local_exchange_sink_operator.h"
25
#include "exec/exchange/local_exchange_source_operator.h"
26
#include "exec/operator/aggregation_sink_operator.h"
27
#include "exec/operator/aggregation_source_operator.h"
28
#include "exec/operator/analytic_sink_operator.h"
29
#include "exec/operator/analytic_source_operator.h"
30
#include "exec/operator/assert_num_rows_operator.h"
31
#include "exec/operator/blackhole_sink_operator.h"
32
#include "exec/operator/bucketed_aggregation_sink_operator.h"
33
#include "exec/operator/bucketed_aggregation_source_operator.h"
34
#include "exec/operator/cache_sink_operator.h"
35
#include "exec/operator/cache_source_operator.h"
36
#include "exec/operator/datagen_operator.h"
37
#include "exec/operator/dict_sink_operator.h"
38
#include "exec/operator/distinct_streaming_aggregation_operator.h"
39
#include "exec/operator/empty_set_operator.h"
40
#include "exec/operator/exchange_sink_operator.h"
41
#include "exec/operator/exchange_source_operator.h"
42
#include "exec/operator/file_scan_operator.h"
43
#include "exec/operator/group_commit_block_sink_operator.h"
44
#include "exec/operator/group_commit_scan_operator.h"
45
#include "exec/operator/hashjoin_build_sink.h"
46
#include "exec/operator/hashjoin_probe_operator.h"
47
#include "exec/operator/hive_table_sink_operator.h"
48
#include "exec/operator/iceberg_delete_sink_operator.h"
49
#include "exec/operator/iceberg_merge_sink_operator.h"
50
#include "exec/operator/iceberg_table_sink_operator.h"
51
#include "exec/operator/jdbc_scan_operator.h"
52
#include "exec/operator/jdbc_table_sink_operator.h"
53
#include "exec/operator/local_merge_sort_source_operator.h"
54
#include "exec/operator/materialization_opertor.h"
55
#include "exec/operator/maxcompute_table_sink_operator.h"
56
#include "exec/operator/memory_scratch_sink_operator.h"
57
#include "exec/operator/meta_scan_operator.h"
58
#include "exec/operator/mock_operator.h"
59
#include "exec/operator/mock_scan_operator.h"
60
#include "exec/operator/multi_cast_data_stream_sink.h"
61
#include "exec/operator/multi_cast_data_stream_source.h"
62
#include "exec/operator/nested_loop_join_build_operator.h"
63
#include "exec/operator/nested_loop_join_probe_operator.h"
64
#include "exec/operator/olap_scan_operator.h"
65
#include "exec/operator/olap_table_sink_operator.h"
66
#include "exec/operator/olap_table_sink_v2_operator.h"
67
#include "exec/operator/partition_sort_sink_operator.h"
68
#include "exec/operator/partition_sort_source_operator.h"
69
#include "exec/operator/partitioned_aggregation_sink_operator.h"
70
#include "exec/operator/partitioned_aggregation_source_operator.h"
71
#include "exec/operator/partitioned_hash_join_probe_operator.h"
72
#include "exec/operator/partitioned_hash_join_sink_operator.h"
73
#include "exec/operator/rec_cte_anchor_sink_operator.h"
74
#include "exec/operator/rec_cte_scan_operator.h"
75
#include "exec/operator/rec_cte_sink_operator.h"
76
#include "exec/operator/rec_cte_source_operator.h"
77
#include "exec/operator/repeat_operator.h"
78
#include "exec/operator/result_file_sink_operator.h"
79
#include "exec/operator/result_sink_operator.h"
80
#include "exec/operator/schema_scan_operator.h"
81
#include "exec/operator/select_operator.h"
82
#include "exec/operator/set_probe_sink_operator.h"
83
#include "exec/operator/set_sink_operator.h"
84
#include "exec/operator/set_source_operator.h"
85
#include "exec/operator/sort_sink_operator.h"
86
#include "exec/operator/sort_source_operator.h"
87
#include "exec/operator/spill_iceberg_table_sink_operator.h"
88
#include "exec/operator/spill_sort_sink_operator.h"
89
#include "exec/operator/spill_sort_source_operator.h"
90
#include "exec/operator/streaming_aggregation_operator.h"
91
#include "exec/operator/table_function_operator.h"
92
#include "exec/operator/tvf_table_sink_operator.h"
93
#include "exec/operator/union_sink_operator.h"
94
#include "exec/operator/union_source_operator.h"
95
#include "exec/pipeline/dependency.h"
96
#include "exec/pipeline/pipeline.h"
97
#include "exprs/vexpr.h"
98
#include "exprs/vexpr_context.h"
99
#include "runtime/runtime_profile.h"
100
#include "runtime/runtime_profile_counter_names.h"
101
#include "util/debug_util.h"
102
#include "util/string_util.h"
103
104
namespace doris {
105
class RowDescriptor;
106
class RuntimeState;
107
} // namespace doris
108
109
namespace doris {
110
111
0
Status OperatorBase::close(RuntimeState* state) {
112
0
    if (_is_closed) {
113
0
        return Status::OK();
114
0
    }
115
0
    _is_closed = true;
116
0
    return Status::OK();
117
0
}
118
119
template <typename SharedStateArg>
120
1.69M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.69M
    if (_parent->nereids_id() == -1) {
122
893k
        return fmt::format("(id={})", _parent->node_id());
123
893k
    } else {
124
804k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
804k
    }
126
1.69M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
68.3k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
68.3k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
68.3k
    } else {
124
68.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
68.3k
    }
126
68.3k
}
_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
187k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
187k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
187k
    } else {
124
187k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
187k
    }
126
187k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
28
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
28
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
28
    } else {
124
28
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
28
    }
126
28
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
7.17k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
7.17k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
7.17k
    } else {
124
7.17k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7.17k
    }
126
7.17k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
10.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
10.0k
    if (_parent->nereids_id() == -1) {
122
11
        return fmt::format("(id={})", _parent->node_id());
123
9.99k
    } else {
124
9.99k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
9.99k
    }
126
10.0k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
82.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
82.8k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
82.8k
    } else {
124
82.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
82.8k
    }
126
82.8k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
526
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
526
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
526
    } else {
124
526
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
526
    }
126
526
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
132
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
132
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
132
    } else {
124
132
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
132
    }
126
132
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
689k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
689k
    if (_parent->nereids_id() == -1) {
122
298k
        return fmt::format("(id={})", _parent->node_id());
123
391k
    } else {
124
391k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
391k
    }
126
689k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
51.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
51.0k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
51.0k
    } else {
124
51.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
51.0k
    }
126
51.0k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
17
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
17
    if (_parent->nereids_id() == -1) {
122
17
        return fmt::format("(id={})", _parent->node_id());
123
17
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
17
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.50k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.51k
    if (_parent->nereids_id() == -1) {
122
5.51k
        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
5.50k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
421
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
421
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
319
    } else {
124
319
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
319
    }
126
421
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.64k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.64k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
4.63k
    } else {
124
4.63k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4.63k
    }
126
4.64k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
590k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
590k
    if (_parent->nereids_id() == -1) {
122
589k
        return fmt::format("(id={})", _parent->node_id());
123
589k
    } else {
124
500
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
500
    }
126
590k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
163
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
163
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
163
    } else {
124
163
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
163
    }
126
163
}
127
128
template <typename SharedStateArg>
129
1.04M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.04M
    if (_parent->nereids_id() == -1) {
131
625k
        return fmt::format("(id={})", _parent->node_id());
132
625k
    } else {
133
414k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
414k
    }
135
1.04M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
116k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
116k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
116k
    } else {
133
116k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
116k
    }
135
116k
}
_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
190k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
190k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
190k
    } else {
133
190k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
190k
    }
135
190k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
35
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
35
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
35
    } else {
133
35
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
35
    }
135
35
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.46k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.46k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
7.46k
    } else {
133
7.46k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.46k
    }
135
7.46k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
10.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
10.3k
    if (_parent->nereids_id() == -1) {
131
11
        return fmt::format("(id={})", _parent->node_id());
132
10.3k
    } else {
133
10.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
10.3k
    }
135
10.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
83.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
83.3k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
83.2k
    } else {
133
83.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
83.2k
    }
135
83.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
541
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
541
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
541
    } else {
133
541
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
541
    }
135
541
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
142
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
142
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
142
    } else {
133
142
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
142
    }
135
142
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
21
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
21
    if (_parent->nereids_id() == -1) {
131
21
        return fmt::format("(id={})", _parent->node_id());
132
21
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
21
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.05k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.05k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
5.05k
    } else {
133
5.05k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.05k
    }
135
5.05k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
421
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
421
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
319
    } else {
133
319
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
319
    }
135
421
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.6k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.6k
    if (_parent->nereids_id() == -1) {
131
12.6k
        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.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
241k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
242k
    if (_parent->nereids_id() == -1) {
131
242k
        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
241k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
370k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
370k
    if (_parent->nereids_id() == -1) {
131
370k
        return fmt::format("(id={})", _parent->node_id());
132
370k
    } else {
133
491
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
491
    }
135
370k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
17
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
17
    if (_parent->nereids_id() == -1) {
131
17
        return fmt::format("(id={})", _parent->node_id());
132
17
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
17
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
326
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
326
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
326
    } else {
133
326
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
326
    }
135
326
}
136
137
template <typename SharedStateArg>
138
27.2k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
27.2k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
27.2k
    _terminated = true;
143
27.2k
    return Status::OK();
144
27.2k
}
_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
601
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
601
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
601
    _terminated = true;
143
601
    return Status::OK();
144
601
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1
    _terminated = true;
143
1
    return Status::OK();
144
1
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
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
880
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
880
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
880
    _terminated = true;
143
880
    return Status::OK();
144
880
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_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
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.35k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.35k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.35k
    _terminated = true;
143
1.35k
    return Status::OK();
144
1.35k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_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
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
67
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
67
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
67
    _terminated = true;
143
67
    return Status::OK();
144
67
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
117
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
117
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
117
    _terminated = true;
143
117
    return Status::OK();
144
117
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
154
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
154
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
154
    _terminated = true;
143
154
    return Status::OK();
144
154
}
145
146
298k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
298k
    return _child && _child->is_serial_operator() && !is_source()
148
298k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
298k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
298k
}
151
152
28.9k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
28.9k
    if (!_child) {
154
27.8k
        return false;
155
27.8k
    }
156
1.09k
    if (_child->is_serial_operator()) {
157
160
        return true;
158
160
    }
159
934
    const auto child_distribution = _child->required_data_distribution(state);
160
934
    return child_distribution.need_local_exchange() &&
161
934
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.09k
}
163
164
81.7k
const RowDescriptor& OperatorBase::row_desc() const {
165
81.7k
    return _child->row_desc();
166
81.7k
}
167
168
template <typename SharedStateArg>
169
23.1k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
23.1k
    fmt::memory_buffer debug_string_buffer;
171
23.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
23.1k
    return fmt::to_string(debug_string_buffer);
173
23.1k
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
192
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
192
    fmt::memory_buffer debug_string_buffer;
171
192
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
192
    return fmt::to_string(debug_string_buffer);
173
192
}
_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
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
64
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
64
    fmt::memory_buffer debug_string_buffer;
171
64
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
64
    return fmt::to_string(debug_string_buffer);
173
64
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
48
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
48
    fmt::memory_buffer debug_string_buffer;
171
48
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
48
    return fmt::to_string(debug_string_buffer);
173
48
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
64
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
64
    fmt::memory_buffer debug_string_buffer;
171
64
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
64
    return fmt::to_string(debug_string_buffer);
173
64
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
20.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
20.6k
    fmt::memory_buffer debug_string_buffer;
171
20.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
20.6k
    return fmt::to_string(debug_string_buffer);
173
20.6k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
2
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
2
    fmt::memory_buffer debug_string_buffer;
171
2
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
2
    return fmt::to_string(debug_string_buffer);
173
2
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
2.07k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
2.07k
    fmt::memory_buffer debug_string_buffer;
171
2.07k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
2.07k
    return fmt::to_string(debug_string_buffer);
173
2.07k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
174
175
template <typename SharedStateArg>
176
22.8k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
22.8k
    fmt::memory_buffer debug_string_buffer;
178
22.8k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
22.8k
    return fmt::to_string(debug_string_buffer);
180
22.8k
}
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
176
48
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
48
    fmt::memory_buffer debug_string_buffer;
178
48
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
48
    return fmt::to_string(debug_string_buffer);
180
48
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
176
64
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
64
    fmt::memory_buffer debug_string_buffer;
178
64
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
64
    return fmt::to_string(debug_string_buffer);
180
64
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
176
48
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
48
    fmt::memory_buffer debug_string_buffer;
178
48
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
48
    return fmt::to_string(debug_string_buffer);
180
48
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
176
64
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
64
    fmt::memory_buffer debug_string_buffer;
178
64
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
64
    return fmt::to_string(debug_string_buffer);
180
64
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
176
2.04k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
2.04k
    fmt::memory_buffer debug_string_buffer;
178
2.04k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
2.04k
    return fmt::to_string(debug_string_buffer);
180
2.04k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
176
117
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
117
    fmt::memory_buffer debug_string_buffer;
178
117
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
117
    return fmt::to_string(debug_string_buffer);
180
117
}
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
176
20.4k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
20.4k
    fmt::memory_buffer debug_string_buffer;
178
20.4k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
20.4k
    return fmt::to_string(debug_string_buffer);
180
20.4k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
181
182
23.7k
std::string OperatorXBase::debug_string(int indentation_level) const {
183
23.7k
    fmt::memory_buffer debug_string_buffer;
184
23.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
185
23.7k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
186
23.7k
                   _is_serial_operator);
187
23.7k
    return fmt::to_string(debug_string_buffer);
188
23.7k
}
189
190
23.1k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
191
23.1k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
192
23.1k
}
193
194
636k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
195
636k
    std::string node_name = print_plan_node_type(tnode.node_type);
196
636k
    _nereids_id = tnode.nereids_id;
197
636k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
198
3.15k
        if (!tnode.__isset.output_tuple_id) {
199
0
            return Status::InternalError("no final output tuple id");
200
0
        }
201
3.15k
        if (tnode.intermediate_output_tuple_id_list.size() !=
202
3.15k
            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
3.15k
    }
210
636k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
211
636k
    _op_name = substr + "_OPERATOR";
212
213
636k
    if (tnode.__isset.vconjunct) {
214
0
        return Status::InternalError("vconjunct is not supported yet");
215
636k
    } else if (tnode.__isset.conjuncts) {
216
251k
        for (const auto& conjunct : tnode.conjuncts) {
217
251k
            VExprContextSPtr context;
218
251k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
219
251k
            _conjuncts.emplace_back(context);
220
251k
        }
221
86.9k
    }
222
223
    // create the projections expr
224
636k
    if (tnode.__isset.projections) {
225
236k
        DCHECK(tnode.__isset.output_tuple_id);
226
236k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
227
236k
    }
228
636k
    if (!tnode.intermediate_projections_list.empty()) {
229
3.15k
        DCHECK(tnode.__isset.projections) << "no final projections";
230
3.15k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
231
4.13k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
232
4.13k
            VExprContextSPtrs projections;
233
4.13k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
234
4.13k
            _intermediate_projections.push_back(projections);
235
4.13k
        }
236
3.15k
    }
237
636k
    return Status::OK();
238
636k
}
239
240
662k
Status OperatorXBase::prepare(RuntimeState* state) {
241
662k
    for (auto& conjunct : _conjuncts) {
242
251k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
243
251k
    }
244
662k
    if (state->enable_adjust_conjunct_order_by_cost()) {
245
612k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
246
324k
            return a->execute_cost() < b->execute_cost();
247
324k
        });
248
612k
    };
249
250
667k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
251
4.14k
        RETURN_IF_ERROR(
252
4.14k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
253
4.14k
    }
254
662k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
255
256
662k
    if (has_output_row_desc()) {
257
236k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
258
236k
    }
259
260
662k
    for (auto& conjunct : _conjuncts) {
261
251k
        RETURN_IF_ERROR(conjunct->open(state));
262
251k
    }
263
662k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
264
662k
    for (auto& projections : _intermediate_projections) {
265
4.14k
        RETURN_IF_ERROR(VExpr::open(projections, state));
266
4.14k
    }
267
662k
    if (_child && !is_source()) {
268
124k
        RETURN_IF_ERROR(_child->prepare(state));
269
124k
    }
270
271
662k
    if (VExpr::contains_blockable_function(_conjuncts) ||
272
662k
        VExpr::contains_blockable_function(_projections)) {
273
0
        _blockable = true;
274
0
    }
275
276
662k
    return Status::OK();
277
662k
}
278
279
3.64k
Status OperatorXBase::terminate(RuntimeState* state) {
280
3.64k
    if (_child && !is_source()) {
281
437
        RETURN_IF_ERROR(_child->terminate(state));
282
437
    }
283
3.64k
    auto result = state->get_local_state_result(operator_id());
284
3.64k
    if (!result) {
285
0
        return result.error();
286
0
    }
287
3.64k
    return result.value()->terminate(state);
288
3.64k
}
289
290
4.80M
Status OperatorXBase::close(RuntimeState* state) {
291
4.80M
    if (_child && !is_source()) {
292
933k
        RETURN_IF_ERROR(_child->close(state));
293
933k
    }
294
4.80M
    auto result = state->get_local_state_result(operator_id());
295
4.80M
    if (!result) {
296
0
        return result.error();
297
0
    }
298
4.80M
    return result.value()->close(state);
299
4.80M
}
300
301
263k
void PipelineXLocalStateBase::clear_origin_block() {
302
263k
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
303
263k
}
304
305
453k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
306
453k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
307
308
453k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
309
453k
    return Status::OK();
310
453k
}
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
263k
                                     Block* output_block) const {
319
263k
    auto* local_state = state->get_local_state(operator_id());
320
263k
    SCOPED_TIMER(local_state->exec_time_counter());
321
263k
    SCOPED_TIMER(local_state->_projection_timer);
322
263k
    const size_t rows = origin_block->rows();
323
263k
    if (rows == 0) {
324
144k
        return Status::OK();
325
144k
    }
326
119k
    Block input_block = *origin_block;
327
328
119k
    size_t bytes_usage = 0;
329
119k
    ColumnsWithTypeAndName new_columns;
330
119k
    for (const auto& projections : local_state->_intermediate_projections) {
331
1.34k
        if (projections.empty()) {
332
0
            return Status::InternalError("meet empty intermediate projection, node id: {}",
333
0
                                         node_id());
334
0
        }
335
1.34k
        new_columns.resize(projections.size());
336
8.39k
        for (int i = 0; i < projections.size(); i++) {
337
7.05k
            RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
338
7.05k
            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
7.05k
        }
346
1.34k
        Block tmp_block {new_columns};
347
1.34k
        bytes_usage += tmp_block.allocated_bytes();
348
1.34k
        input_block.swap(tmp_block);
349
1.34k
    }
350
351
119k
    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
541k
    auto insert_column_datas = [&](auto& to, ColumnPtr& from, size_t rows) {
358
541k
        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
541k
        } else {
368
541k
            if (_keep_origin || !from->is_exclusive()) {
369
541k
                to->insert_range_from(*from, 0, rows);
370
541k
                bytes_usage += from->allocated_bytes();
371
18.4E
            } else {
372
18.4E
                to = from->assert_mutable();
373
18.4E
            }
374
541k
        }
375
541k
    };
376
377
119k
    auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
378
119k
            output_block, *_output_row_descriptor);
379
119k
    auto& mutable_block = scoped_mutable_block.mutable_block();
380
119k
    auto& mutable_columns = mutable_block.mutable_columns();
381
119k
    if (rows != 0) {
382
119k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
383
661k
        for (int i = 0; i < mutable_columns.size(); ++i) {
384
541k
            ColumnPtr column_ptr;
385
541k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
386
541k
            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
541k
            column_ptr = column_ptr->convert_to_full_column_if_const();
393
541k
            bytes_usage += column_ptr->allocated_bytes();
394
541k
            insert_column_datas(mutable_columns[i], column_ptr, rows);
395
541k
        }
396
119k
        DCHECK(mutable_block.rows() == rows);
397
119k
    }
398
119k
    local_state->_estimate_memory_usage += bytes_usage;
399
400
119k
    return Status::OK();
401
119k
}
402
403
4.03M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
404
4.03M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
405
4.03M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
406
4.03M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
407
4.03M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
408
4.03M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
409
4.03M
            if (_debug_point_count++ % 2 == 0) {
410
4.03M
                return Status::OK();
411
4.03M
            }
412
4.03M
        }
413
4.03M
    });
414
415
4.03M
    Status status;
416
4.03M
    auto* local_state = state->get_local_state(operator_id());
417
4.03M
    Defer defer([&]() {
418
4.03M
        if (status.ok()) {
419
4.03M
            local_state->update_output_block_counters(*block);
420
4.03M
        }
421
4.03M
    });
422
4.03M
    if (_output_row_descriptor) {
423
263k
        local_state->clear_origin_block();
424
263k
        status = get_block(state, &local_state->_origin_block, eos);
425
263k
        if (UNLIKELY(!status.ok())) {
426
20
            return status;
427
20
        }
428
263k
        status = do_projections(state, &local_state->_origin_block, block);
429
263k
        return status;
430
263k
    }
431
3.77M
    status = get_block(state, block, eos);
432
3.77M
    RETURN_IF_ERROR(block->check_type_and_column());
433
3.77M
    return status;
434
3.77M
}
435
436
2.26M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
437
2.26M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
438
4.72k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
439
4.72k
        *eos = true;
440
4.72k
    }
441
442
2.26M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
443
2.26M
        auto op_name = to_lower(_parent->_op_name);
444
2.26M
        auto arg_op_name = dp->param<std::string>("op_name");
445
2.26M
        arg_op_name = to_lower(arg_op_name);
446
447
2.26M
        if (op_name == arg_op_name) {
448
2.26M
            *eos = true;
449
2.26M
        }
450
2.26M
    });
451
452
2.26M
    if (auto rows = block->rows()) {
453
676k
        _num_rows_returned += rows;
454
676k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
455
676k
    }
456
2.26M
}
457
458
27.1k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
459
27.1k
    auto result = state->get_sink_local_state_result();
460
27.1k
    if (!result) {
461
0
        return result.error();
462
0
    }
463
27.1k
    return result.value()->terminate(state);
464
27.1k
}
465
466
23.4k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
467
23.4k
    fmt::memory_buffer debug_string_buffer;
468
469
23.4k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
470
23.4k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
471
23.4k
    return fmt::to_string(debug_string_buffer);
472
23.4k
}
473
474
22.8k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
475
22.8k
    return state->get_sink_local_state()->debug_string(indentation_level);
476
22.8k
}
477
478
330k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
479
330k
    std::string op_name = "UNKNOWN_SINK";
480
330k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
481
482
331k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
483
331k
        op_name = it->second;
484
331k
    }
485
330k
    _name = op_name + "_OPERATOR";
486
330k
    return Status::OK();
487
330k
}
488
489
252k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
490
252k
    std::string op_name = print_plan_node_type(tnode.node_type);
491
252k
    _nereids_id = tnode.nereids_id;
492
252k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
493
252k
    _name = substr + "_SINK_OPERATOR";
494
252k
    return Status::OK();
495
252k
}
496
497
template <typename LocalStateType>
498
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
499
1.55M
                                                            LocalSinkStateInfo& info) {
500
1.55M
    auto local_state = LocalStateType::create_unique(this, state);
501
1.55M
    RETURN_IF_ERROR(local_state->init(state, info));
502
1.55M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
1.55M
    return Status::OK();
504
1.55M
}
_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
329k
                                                            LocalSinkStateInfo& info) {
500
329k
    auto local_state = LocalStateType::create_unique(this, state);
501
329k
    RETURN_IF_ERROR(local_state->init(state, info));
502
329k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
329k
    return Status::OK();
504
329k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_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
361
                                                            LocalSinkStateInfo& info) {
500
361
    auto local_state = LocalStateType::create_unique(this, state);
501
361
    RETURN_IF_ERROR(local_state->init(state, info));
502
361
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
361
    return Status::OK();
504
361
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
40.8k
                                                            LocalSinkStateInfo& info) {
500
40.8k
    auto local_state = LocalStateType::create_unique(this, state);
501
40.8k
    RETURN_IF_ERROR(local_state->init(state, info));
502
40.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
40.8k
    return Status::OK();
504
40.8k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
56
                                                            LocalSinkStateInfo& info) {
500
56
    auto local_state = LocalStateType::create_unique(this, state);
501
56
    RETURN_IF_ERROR(local_state->init(state, info));
502
56
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
56
    return Status::OK();
504
56
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
10.3k
                                                            LocalSinkStateInfo& info) {
500
10.3k
    auto local_state = LocalStateType::create_unique(this, state);
501
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
502
10.3k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
10.3k
    return Status::OK();
504
10.3k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
18
                                                            LocalSinkStateInfo& info) {
500
18
    auto local_state = LocalStateType::create_unique(this, state);
501
18
    RETURN_IF_ERROR(local_state->init(state, info));
502
18
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
18
    return Status::OK();
504
18
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
191k
                                                            LocalSinkStateInfo& info) {
500
191k
    auto local_state = LocalStateType::create_unique(this, state);
501
191k
    RETURN_IF_ERROR(local_state->init(state, info));
502
191k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
191k
    return Status::OK();
504
191k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
35
                                                            LocalSinkStateInfo& info) {
500
35
    auto local_state = LocalStateType::create_unique(this, state);
501
35
    RETURN_IF_ERROR(local_state->init(state, info));
502
35
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
35
    return Status::OK();
504
35
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
242k
                                                            LocalSinkStateInfo& info) {
500
242k
    auto local_state = LocalStateType::create_unique(this, state);
501
242k
    RETURN_IF_ERROR(local_state->init(state, info));
502
242k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
242k
    return Status::OK();
504
242k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
83.4k
                                                            LocalSinkStateInfo& info) {
500
83.4k
    auto local_state = LocalStateType::create_unique(this, state);
501
83.4k
    RETURN_IF_ERROR(local_state->init(state, info));
502
83.4k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
83.4k
    return Status::OK();
504
83.4k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
543
                                                            LocalSinkStateInfo& info) {
500
543
    auto local_state = LocalStateType::create_unique(this, state);
501
543
    RETURN_IF_ERROR(local_state->init(state, info));
502
543
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
543
    return Status::OK();
504
543
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
142
                                                            LocalSinkStateInfo& info) {
500
142
    auto local_state = LocalStateType::create_unique(this, state);
501
142
    RETURN_IF_ERROR(local_state->init(state, info));
502
142
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
142
    return Status::OK();
504
142
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
511k
                                                            LocalSinkStateInfo& info) {
500
511k
    auto local_state = LocalStateType::create_unique(this, state);
501
511k
    RETURN_IF_ERROR(local_state->init(state, info));
502
511k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
511k
    return Status::OK();
504
511k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
7.50k
                                                            LocalSinkStateInfo& info) {
500
7.50k
    auto local_state = LocalStateType::create_unique(this, state);
501
7.50k
    RETURN_IF_ERROR(local_state->init(state, info));
502
7.50k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
7.50k
    return Status::OK();
504
7.50k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
5.03k
                                                            LocalSinkStateInfo& info) {
500
5.03k
    auto local_state = LocalStateType::create_unique(this, state);
501
5.03k
    RETURN_IF_ERROR(local_state->init(state, info));
502
5.03k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
5.03k
    return Status::OK();
504
5.03k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
2.26k
                                                            LocalSinkStateInfo& info) {
500
2.26k
    auto local_state = LocalStateType::create_unique(this, state);
501
2.26k
    RETURN_IF_ERROR(local_state->init(state, info));
502
2.26k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
2.26k
    return Status::OK();
504
2.26k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
319
                                                            LocalSinkStateInfo& info) {
500
319
    auto local_state = LocalStateType::create_unique(this, state);
501
319
    RETURN_IF_ERROR(local_state->init(state, info));
502
319
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
319
    return Status::OK();
504
319
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
4.86k
                                                            LocalSinkStateInfo& info) {
500
4.86k
    auto local_state = LocalStateType::create_unique(this, state);
501
4.86k
    RETURN_IF_ERROR(local_state->init(state, info));
502
4.86k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
4.86k
    return Status::OK();
504
4.86k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
2.70k
                                                            LocalSinkStateInfo& info) {
500
2.70k
    auto local_state = LocalStateType::create_unique(this, state);
501
2.70k
    RETURN_IF_ERROR(local_state->init(state, info));
502
2.70k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
2.70k
    return Status::OK();
504
2.70k
}
_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.52k
                                                            LocalSinkStateInfo& info) {
500
2.52k
    auto local_state = LocalStateType::create_unique(this, state);
501
2.52k
    RETURN_IF_ERROR(local_state->init(state, info));
502
2.52k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
2.52k
    return Status::OK();
504
2.52k
}
_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
168
                                                            LocalSinkStateInfo& info) {
500
168
    auto local_state = LocalStateType::create_unique(this, state);
501
168
    RETURN_IF_ERROR(local_state->init(state, info));
502
168
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
168
    return Status::OK();
504
168
}
_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
104
                                                            LocalSinkStateInfo& info) {
500
104
    auto local_state = LocalStateType::create_unique(this, state);
501
104
    RETURN_IF_ERROR(local_state->init(state, info));
502
104
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
104
    return Status::OK();
504
104
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
163
                                                            LocalSinkStateInfo& info) {
500
163
    auto local_state = LocalStateType::create_unique(this, state);
501
163
    RETURN_IF_ERROR(local_state->init(state, info));
502
163
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
163
    return Status::OK();
504
163
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
163
                                                            LocalSinkStateInfo& info) {
500
163
    auto local_state = LocalStateType::create_unique(this, state);
501
163
    RETURN_IF_ERROR(local_state->init(state, info));
502
163
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
163
    return Status::OK();
504
163
}
505
506
template <typename LocalStateType>
507
1.28M
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.28M
    } else {
515
1.28M
        auto ss = LocalStateType::SharedStateType::create_shared();
516
1.28M
        ss->id = operator_id();
517
1.28M
        for (auto& dest : dests_id()) {
518
1.27M
            ss->related_op_ids.insert(dest);
519
1.27M
        }
520
1.28M
        return ss;
521
1.28M
    }
522
1.28M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
100k
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
100k
    } else {
515
100k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
100k
        ss->id = operator_id();
517
100k
        for (auto& dest : dests_id()) {
518
99.8k
            ss->related_op_ids.insert(dest);
519
99.8k
        }
520
100k
        return ss;
521
100k
    }
522
100k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
330k
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
330k
    } else {
515
330k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
330k
        ss->id = operator_id();
517
330k
        for (auto& dest : dests_id()) {
518
328k
            ss->related_op_ids.insert(dest);
519
328k
        }
520
330k
        return ss;
521
330k
    }
522
330k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_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
361
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
361
    } else {
515
361
        auto ss = LocalStateType::SharedStateType::create_shared();
516
361
        ss->id = operator_id();
517
361
        for (auto& dest : dests_id()) {
518
361
            ss->related_op_ids.insert(dest);
519
361
        }
520
361
        return ss;
521
361
    }
522
361
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
40.8k
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
40.8k
    } else {
515
40.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
40.8k
        ss->id = operator_id();
517
40.8k
        for (auto& dest : dests_id()) {
518
40.6k
            ss->related_op_ids.insert(dest);
519
40.6k
        }
520
40.8k
        return ss;
521
40.8k
    }
522
40.8k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
507
56
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
56
    } else {
515
56
        auto ss = LocalStateType::SharedStateType::create_shared();
516
56
        ss->id = operator_id();
517
56
        for (auto& dest : dests_id()) {
518
56
            ss->related_op_ids.insert(dest);
519
56
        }
520
56
        return ss;
521
56
    }
522
56
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
10.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
10.4k
    } else {
515
10.4k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
10.4k
        ss->id = operator_id();
517
10.4k
        for (auto& dest : dests_id()) {
518
10.4k
            ss->related_op_ids.insert(dest);
519
10.4k
        }
520
10.4k
        return ss;
521
10.4k
    }
522
10.4k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
18
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
18
    } else {
515
18
        auto ss = LocalStateType::SharedStateType::create_shared();
516
18
        ss->id = operator_id();
517
18
        for (auto& dest : dests_id()) {
518
18
            ss->related_op_ids.insert(dest);
519
18
        }
520
18
        return ss;
521
18
    }
522
18
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
191k
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
191k
    } else {
515
191k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
191k
        ss->id = operator_id();
517
191k
        for (auto& dest : dests_id()) {
518
191k
            ss->related_op_ids.insert(dest);
519
191k
        }
520
191k
        return ss;
521
191k
    }
522
191k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
37
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
37
    } else {
515
37
        auto ss = LocalStateType::SharedStateType::create_shared();
516
37
        ss->id = operator_id();
517
37
        for (auto& dest : dests_id()) {
518
37
            ss->related_op_ids.insert(dest);
519
37
        }
520
37
        return ss;
521
37
    }
522
37
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
83.6k
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
83.6k
    } else {
515
83.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
83.6k
        ss->id = operator_id();
517
83.6k
        for (auto& dest : dests_id()) {
518
83.5k
            ss->related_op_ids.insert(dest);
519
83.5k
        }
520
83.6k
        return ss;
521
83.6k
    }
522
83.6k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
141
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
141
    } else {
515
141
        auto ss = LocalStateType::SharedStateType::create_shared();
516
141
        ss->id = operator_id();
517
141
        for (auto& dest : dests_id()) {
518
141
            ss->related_op_ids.insert(dest);
519
141
        }
520
141
        return ss;
521
141
    }
522
141
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
511k
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
511k
    } else {
515
511k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
511k
        ss->id = operator_id();
517
511k
        for (auto& dest : dests_id()) {
518
504k
            ss->related_op_ids.insert(dest);
519
504k
        }
520
511k
        return ss;
521
511k
    }
522
511k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
7.56k
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
7.56k
    } else {
515
7.56k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
7.56k
        ss->id = operator_id();
517
7.56k
        for (auto& dest : dests_id()) {
518
7.54k
            ss->related_op_ids.insert(dest);
519
7.54k
        }
520
7.56k
        return ss;
521
7.56k
    }
522
7.56k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
421
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
421
    } else {
515
421
        auto ss = LocalStateType::SharedStateType::create_shared();
516
421
        ss->id = operator_id();
517
421
        for (auto& dest : dests_id()) {
518
420
            ss->related_op_ids.insert(dest);
519
420
        }
520
421
        return ss;
521
421
    }
522
421
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
507
2.58k
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.58k
    } else {
515
2.58k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
2.58k
        ss->id = operator_id();
517
2.58k
        for (auto& dest : dests_id()) {
518
2.57k
            ss->related_op_ids.insert(dest);
519
2.57k
        }
520
2.58k
        return ss;
521
2.58k
    }
522
2.58k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
507
2.54k
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.54k
    } else {
515
2.54k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
2.54k
        ss->id = operator_id();
517
2.54k
        for (auto& dest : dests_id()) {
518
2.52k
            ss->related_op_ids.insert(dest);
519
2.52k
        }
520
2.54k
        return ss;
521
2.54k
    }
522
2.54k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
168
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
168
    } else {
515
168
        auto ss = LocalStateType::SharedStateType::create_shared();
516
168
        ss->id = operator_id();
517
168
        for (auto& dest : dests_id()) {
518
168
            ss->related_op_ids.insert(dest);
519
168
        }
520
168
        return ss;
521
168
    }
522
168
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
104
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
104
    } else {
515
104
        auto ss = LocalStateType::SharedStateType::create_shared();
516
104
        ss->id = operator_id();
517
104
        for (auto& dest : dests_id()) {
518
104
            ss->related_op_ids.insert(dest);
519
104
        }
520
104
        return ss;
521
104
    }
522
104
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
523
524
template <typename LocalStateType>
525
1.94M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
1.94M
    auto local_state = LocalStateType::create_unique(state, this);
527
1.94M
    RETURN_IF_ERROR(local_state->init(state, info));
528
1.94M
    state->emplace_local_state(operator_id(), std::move(local_state));
529
1.94M
    return Status::OK();
530
1.94M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
68.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
68.4k
    auto local_state = LocalStateType::create_unique(state, this);
527
68.4k
    RETURN_IF_ERROR(local_state->init(state, info));
528
68.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
68.4k
    return Status::OK();
530
68.4k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
228k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
228k
    auto local_state = LocalStateType::create_unique(state, this);
527
228k
    RETURN_IF_ERROR(local_state->init(state, info));
528
228k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
228k
    return Status::OK();
530
228k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
79
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
79
    auto local_state = LocalStateType::create_unique(state, this);
527
79
    RETURN_IF_ERROR(local_state->init(state, info));
528
79
    state->emplace_local_state(operator_id(), std::move(local_state));
529
79
    return Status::OK();
530
79
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
2.68k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.68k
    auto local_state = LocalStateType::create_unique(state, this);
527
2.68k
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.68k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.68k
    return Status::OK();
530
2.68k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
10.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
10.2k
    auto local_state = LocalStateType::create_unique(state, this);
527
10.2k
    RETURN_IF_ERROR(local_state->init(state, info));
528
10.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
10.2k
    return Status::OK();
530
10.2k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
10.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
10.0k
    auto local_state = LocalStateType::create_unique(state, this);
527
10.0k
    RETURN_IF_ERROR(local_state->init(state, info));
528
10.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
10.0k
    return Status::OK();
530
10.0k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
28
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
28
    auto local_state = LocalStateType::create_unique(state, this);
527
28
    RETURN_IF_ERROR(local_state->init(state, info));
528
28
    state->emplace_local_state(operator_id(), std::move(local_state));
529
28
    return Status::OK();
530
28
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
179k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
179k
    auto local_state = LocalStateType::create_unique(state, this);
527
179k
    RETURN_IF_ERROR(local_state->init(state, info));
528
179k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
179k
    return Status::OK();
530
179k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
83.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
83.1k
    auto local_state = LocalStateType::create_unique(state, this);
527
83.1k
    RETURN_IF_ERROR(local_state->init(state, info));
528
83.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
83.1k
    return Status::OK();
530
83.1k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
529
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
529
    auto local_state = LocalStateType::create_unique(state, this);
527
529
    RETURN_IF_ERROR(local_state->init(state, info));
528
529
    state->emplace_local_state(operator_id(), std::move(local_state));
529
529
    return Status::OK();
530
529
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
132
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
132
    auto local_state = LocalStateType::create_unique(state, this);
527
132
    RETURN_IF_ERROR(local_state->init(state, info));
528
132
    state->emplace_local_state(operator_id(), std::move(local_state));
529
132
    return Status::OK();
530
132
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
3.87k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
3.87k
    auto local_state = LocalStateType::create_unique(state, this);
527
3.87k
    RETURN_IF_ERROR(local_state->init(state, info));
528
3.87k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
3.87k
    return Status::OK();
530
3.87k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
301k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
301k
    auto local_state = LocalStateType::create_unique(state, this);
527
301k
    RETURN_IF_ERROR(local_state->init(state, info));
528
301k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
301k
    return Status::OK();
530
301k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
1.43k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
1.43k
    auto local_state = LocalStateType::create_unique(state, this);
527
1.43k
    RETURN_IF_ERROR(local_state->init(state, info));
528
1.43k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
1.43k
    return Status::OK();
530
1.43k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
7.25k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
7.25k
    auto local_state = LocalStateType::create_unique(state, this);
527
7.25k
    RETURN_IF_ERROR(local_state->init(state, info));
528
7.25k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
7.25k
    return Status::OK();
530
7.25k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
21
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
21
    auto local_state = LocalStateType::create_unique(state, this);
527
21
    RETURN_IF_ERROR(local_state->init(state, info));
528
21
    state->emplace_local_state(operator_id(), std::move(local_state));
529
21
    return Status::OK();
530
21
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
1.43k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
1.43k
    auto local_state = LocalStateType::create_unique(state, this);
527
1.43k
    RETURN_IF_ERROR(local_state->init(state, info));
528
1.43k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
1.43k
    return Status::OK();
530
1.43k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
51.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
51.1k
    auto local_state = LocalStateType::create_unique(state, this);
527
51.1k
    RETURN_IF_ERROR(local_state->init(state, info));
528
51.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
51.1k
    return Status::OK();
530
51.1k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
5.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
5.54k
    auto local_state = LocalStateType::create_unique(state, this);
527
5.54k
    RETURN_IF_ERROR(local_state->init(state, info));
528
5.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
5.54k
    return Status::OK();
530
5.54k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
319
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
319
    auto local_state = LocalStateType::create_unique(state, this);
527
319
    RETURN_IF_ERROR(local_state->init(state, info));
528
319
    state->emplace_local_state(operator_id(), std::move(local_state));
529
319
    return Status::OK();
530
319
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
2.47k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.47k
    auto local_state = LocalStateType::create_unique(state, this);
527
2.47k
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.47k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.47k
    return Status::OK();
530
2.47k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
2.46k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.46k
    auto local_state = LocalStateType::create_unique(state, this);
527
2.46k
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.46k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.46k
    return Status::OK();
530
2.46k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
291
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
291
    auto local_state = LocalStateType::create_unique(state, this);
527
291
    RETURN_IF_ERROR(local_state->init(state, info));
528
291
    state->emplace_local_state(operator_id(), std::move(local_state));
529
291
    return Status::OK();
530
291
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
1.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
1.54k
    auto local_state = LocalStateType::create_unique(state, this);
527
1.54k
    RETURN_IF_ERROR(local_state->init(state, info));
528
1.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
1.54k
    return Status::OK();
530
1.54k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
5.69k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
5.69k
    auto local_state = LocalStateType::create_unique(state, this);
527
5.69k
    RETURN_IF_ERROR(local_state->init(state, info));
528
5.69k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
5.69k
    return Status::OK();
530
5.69k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
595k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
595k
    auto local_state = LocalStateType::create_unique(state, this);
527
595k
    RETURN_IF_ERROR(local_state->init(state, info));
528
595k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
595k
    return Status::OK();
530
595k
}
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
163
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
163
    auto local_state = LocalStateType::create_unique(state, this);
527
163
    RETURN_IF_ERROR(local_state->init(state, info));
528
163
    state->emplace_local_state(operator_id(), std::move(local_state));
529
163
    return Status::OK();
530
163
}
_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
715
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
715
    auto local_state = LocalStateType::create_unique(state, this);
527
715
    RETURN_IF_ERROR(local_state->init(state, info));
528
715
    state->emplace_local_state(operator_id(), std::move(local_state));
529
715
    return Status::OK();
530
715
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
860
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
860
    auto local_state = LocalStateType::create_unique(state, this);
527
860
    RETURN_IF_ERROR(local_state->init(state, info));
528
860
    state->emplace_local_state(operator_id(), std::move(local_state));
529
860
    return Status::OK();
530
860
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
5.37k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
5.37k
    auto local_state = LocalStateType::create_unique(state, this);
527
5.37k
    RETURN_IF_ERROR(local_state->init(state, info));
528
5.37k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
5.37k
    return Status::OK();
530
5.37k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
375k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
375k
    auto local_state = LocalStateType::create_unique(state, this);
527
375k
    RETURN_IF_ERROR(local_state->init(state, info));
528
375k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
375k
    return Status::OK();
530
375k
}
531
532
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
533
                                                         RuntimeState* state)
534
1.55M
        : _parent(parent), _state(state) {}
535
536
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
537
1.93M
        : _num_rows_returned(0),
538
1.93M
          _rows_returned_counter(nullptr),
539
1.93M
          _parent(parent),
540
1.93M
          _state(state),
541
1.93M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
542
543
template <typename SharedStateArg>
544
1.95M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
1.95M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
1.95M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
1.95M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
1.95M
    _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.95M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
1.95M
    _operator_profile->add_child(_common_profile.get(), true);
553
1.95M
    _operator_profile->add_child(_custom_profile.get(), true);
554
1.95M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
1.95M
    if constexpr (!is_fake_shared) {
556
1.02M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
600k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
600k
                                    .first.get()
559
600k
                                    ->template cast<SharedStateArg>();
560
561
600k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
600k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
600k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
600k
        } else if (info.shared_state) {
565
342k
            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
342k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
342k
            _dependency = _shared_state->create_source_dependency(
572
342k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
342k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
342k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
342k
        } else {
576
81.2k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
15.4k
                DCHECK(false);
578
15.4k
            }
579
81.2k
        }
580
1.02M
    }
581
582
1.95M
    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.95M
    _rows_returned_counter =
587
1.95M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
1.95M
    _blocks_returned_counter =
589
1.95M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
1.95M
    _output_block_bytes_counter =
591
1.95M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
1.95M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
1.95M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
1.95M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
1.95M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.95M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
1.95M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
1.95M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
1.95M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
1.95M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
1.95M
    _memory_used_counter =
602
1.95M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
1.95M
    _common_profile->add_info_string("IsColocate",
604
1.95M
                                     std::to_string(_parent->is_colocated_operator()));
605
1.95M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
1.95M
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
1.95M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
1.95M
    return Status::OK();
609
1.95M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
69.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
69.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
69.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
69.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
69.0k
    _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.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
69.0k
    _operator_profile->add_child(_common_profile.get(), true);
553
69.0k
    _operator_profile->add_child(_custom_profile.get(), true);
554
69.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
69.0k
    if constexpr (!is_fake_shared) {
556
69.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
15.9k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
15.9k
                                    .first.get()
559
15.9k
                                    ->template cast<SharedStateArg>();
560
561
15.9k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
15.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
15.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
53.0k
        } 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
50.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
50.8k
            _dependency = _shared_state->create_source_dependency(
572
50.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
50.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
50.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
50.8k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
2.25k
        }
580
69.0k
    }
581
582
69.0k
    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.0k
    _rows_returned_counter =
587
69.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
69.0k
    _blocks_returned_counter =
589
69.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
69.0k
    _output_block_bytes_counter =
591
69.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
69.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
69.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
69.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
69.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
69.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
69.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
69.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
69.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
69.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
69.0k
    _memory_used_counter =
602
69.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
69.0k
    _common_profile->add_info_string("IsColocate",
604
69.0k
                                     std::to_string(_parent->is_colocated_operator()));
605
69.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
69.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
69.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
69.0k
    return Status::OK();
609
69.0k
}
_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
191k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
191k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
191k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
191k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
191k
    _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
191k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
191k
    _operator_profile->add_child(_common_profile.get(), true);
553
191k
    _operator_profile->add_child(_custom_profile.get(), true);
554
191k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
191k
    if constexpr (!is_fake_shared) {
556
191k
        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
191k
        } 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
180k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
180k
            _dependency = _shared_state->create_source_dependency(
572
180k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
180k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
180k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
180k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
10.5k
        }
580
191k
    }
581
582
191k
    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
191k
    _rows_returned_counter =
587
191k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
191k
    _blocks_returned_counter =
589
191k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
191k
    _output_block_bytes_counter =
591
191k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
191k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
191k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
191k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
191k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
191k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
191k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
191k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
191k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
191k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
191k
    _memory_used_counter =
602
191k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
191k
    _common_profile->add_info_string("IsColocate",
604
191k
                                     std::to_string(_parent->is_colocated_operator()));
605
191k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
191k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
191k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
191k
    return Status::OK();
609
191k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
28
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
28
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
28
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
28
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
28
    _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
28
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
28
    _operator_profile->add_child(_common_profile.get(), true);
553
28
    _operator_profile->add_child(_custom_profile.get(), true);
554
28
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
28
    if constexpr (!is_fake_shared) {
556
28
        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
28
        } 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
28
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
28
            _dependency = _shared_state->create_source_dependency(
572
28
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
28
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
28
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
28
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
28
    }
581
582
28
    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
28
    _rows_returned_counter =
587
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
28
    _blocks_returned_counter =
589
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
28
    _output_block_bytes_counter =
591
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
28
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
28
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
28
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
28
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
28
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
28
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
28
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
28
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
28
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
28
    _memory_used_counter =
602
28
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
28
    _common_profile->add_info_string("IsColocate",
604
28
                                     std::to_string(_parent->is_colocated_operator()));
605
28
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
28
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
28
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
28
    return Status::OK();
609
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
7.41k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
7.41k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
7.41k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
7.41k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
7.41k
    _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
7.41k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
7.41k
    _operator_profile->add_child(_common_profile.get(), true);
553
7.41k
    _operator_profile->add_child(_custom_profile.get(), true);
554
7.41k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
7.41k
    if constexpr (!is_fake_shared) {
556
7.41k
        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
7.41k
        } 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
6.81k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
6.81k
            _dependency = _shared_state->create_source_dependency(
572
6.81k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
6.81k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
6.81k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
6.81k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
600
        }
580
7.41k
    }
581
582
7.41k
    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
7.41k
    _rows_returned_counter =
587
7.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
7.41k
    _blocks_returned_counter =
589
7.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
7.41k
    _output_block_bytes_counter =
591
7.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
7.41k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
7.41k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
7.41k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
7.41k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.41k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
7.41k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
7.41k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
7.41k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
7.41k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
7.41k
    _memory_used_counter =
602
7.41k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
7.41k
    _common_profile->add_info_string("IsColocate",
604
7.41k
                                     std::to_string(_parent->is_colocated_operator()));
605
7.41k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
7.41k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
7.41k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
7.41k
    return Status::OK();
609
7.41k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
10.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
10.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
10.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
10.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
10.3k
    _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
10.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
10.3k
    _operator_profile->add_child(_common_profile.get(), true);
553
10.3k
    _operator_profile->add_child(_custom_profile.get(), true);
554
10.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
10.3k
    if constexpr (!is_fake_shared) {
556
10.3k
        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
10.3k
        } 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.80k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
9.80k
            _dependency = _shared_state->create_source_dependency(
572
9.80k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
9.80k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
9.80k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
9.80k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
589
        }
580
10.3k
    }
581
582
10.3k
    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
10.3k
    _rows_returned_counter =
587
10.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
10.3k
    _blocks_returned_counter =
589
10.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
10.3k
    _output_block_bytes_counter =
591
10.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
10.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
10.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
10.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
10.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
10.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
10.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
10.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
10.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
10.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
10.3k
    _memory_used_counter =
602
10.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
10.3k
    _common_profile->add_info_string("IsColocate",
604
10.3k
                                     std::to_string(_parent->is_colocated_operator()));
605
10.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
10.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
10.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
10.3k
    return Status::OK();
609
10.3k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
83.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
83.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
83.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
83.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
83.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
83.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
83.5k
    _operator_profile->add_child(_common_profile.get(), true);
553
83.5k
    _operator_profile->add_child(_custom_profile.get(), true);
554
83.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
83.5k
    if constexpr (!is_fake_shared) {
556
83.5k
        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
83.5k
        } 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
81.1k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
81.1k
            _dependency = _shared_state->create_source_dependency(
572
81.1k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
81.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
81.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
81.1k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
2.32k
        }
580
83.5k
    }
581
582
83.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
83.5k
    _rows_returned_counter =
587
83.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
83.5k
    _blocks_returned_counter =
589
83.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
83.5k
    _output_block_bytes_counter =
591
83.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
83.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
83.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
83.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
83.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
83.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
83.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
83.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
83.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
83.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
83.5k
    _memory_used_counter =
602
83.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
83.5k
    _common_profile->add_info_string("IsColocate",
604
83.5k
                                     std::to_string(_parent->is_colocated_operator()));
605
83.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
83.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
83.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
83.5k
    return Status::OK();
609
83.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
541
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
541
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
541
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
541
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
541
    _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
541
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
541
    _operator_profile->add_child(_common_profile.get(), true);
553
541
    _operator_profile->add_child(_custom_profile.get(), true);
554
541
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
541
    if constexpr (!is_fake_shared) {
556
541
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
499
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
499
                                    .first.get()
559
499
                                    ->template cast<SharedStateArg>();
560
561
499
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
499
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
499
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
499
        } 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
42
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
42
        }
580
541
    }
581
582
541
    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
541
    _rows_returned_counter =
587
541
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
541
    _blocks_returned_counter =
589
541
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
541
    _output_block_bytes_counter =
591
541
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
541
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
541
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
541
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
541
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
541
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
541
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
541
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
541
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
541
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
541
    _memory_used_counter =
602
541
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
541
    _common_profile->add_info_string("IsColocate",
604
541
                                     std::to_string(_parent->is_colocated_operator()));
605
541
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
541
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
541
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
541
    return Status::OK();
609
541
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
132
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
132
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
132
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
132
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
132
    _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
132
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
132
    _operator_profile->add_child(_common_profile.get(), true);
553
132
    _operator_profile->add_child(_custom_profile.get(), true);
554
132
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
132
    if constexpr (!is_fake_shared) {
556
132
        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
132
        } 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
132
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
132
            _dependency = _shared_state->create_source_dependency(
572
132
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
132
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
132
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
132
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
132
    }
581
582
132
    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
132
    _rows_returned_counter =
587
132
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
132
    _blocks_returned_counter =
589
132
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
132
    _output_block_bytes_counter =
591
132
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
132
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
132
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
132
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
132
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
132
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
132
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
132
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
132
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
132
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
132
    _memory_used_counter =
602
132
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
132
    _common_profile->add_info_string("IsColocate",
604
132
                                     std::to_string(_parent->is_colocated_operator()));
605
132
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
132
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
132
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
132
    return Status::OK();
609
132
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
928k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
928k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
928k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
928k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
928k
    _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
928k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
928k
    _operator_profile->add_child(_common_profile.get(), true);
553
928k
    _operator_profile->add_child(_custom_profile.get(), true);
554
928k
    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
928k
    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
928k
    _rows_returned_counter =
587
928k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
928k
    _blocks_returned_counter =
589
928k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
928k
    _output_block_bytes_counter =
591
928k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
928k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
928k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
928k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
928k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
928k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
928k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
928k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
928k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
928k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
928k
    _memory_used_counter =
602
928k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
928k
    _common_profile->add_info_string("IsColocate",
604
928k
                                     std::to_string(_parent->is_colocated_operator()));
605
928k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
928k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
928k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
928k
    return Status::OK();
609
928k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
51.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
51.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
51.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
51.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
51.0k
    _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
51.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
51.0k
    _operator_profile->add_child(_common_profile.get(), true);
553
51.0k
    _operator_profile->add_child(_custom_profile.get(), true);
554
51.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
51.0k
    if constexpr (!is_fake_shared) {
556
51.0k
        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
51.0k
        } 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
2.33k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
2.33k
            _dependency = _shared_state->create_source_dependency(
572
2.33k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
2.33k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
2.33k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
48.7k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
48.7k
        }
580
51.0k
    }
581
582
51.0k
    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
51.0k
    _rows_returned_counter =
587
51.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
51.0k
    _blocks_returned_counter =
589
51.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
51.0k
    _output_block_bytes_counter =
591
51.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
51.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
51.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
51.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
51.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
51.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
51.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
51.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
51.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
51.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
51.0k
    _memory_used_counter =
602
51.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
51.0k
    _common_profile->add_info_string("IsColocate",
604
51.0k
                                     std::to_string(_parent->is_colocated_operator()));
605
51.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
51.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
51.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
51.0k
    return Status::OK();
609
51.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
17
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
17
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
17
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
17
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
17
    _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
17
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
17
    _operator_profile->add_child(_common_profile.get(), true);
553
17
    _operator_profile->add_child(_custom_profile.get(), true);
554
17
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
17
    if constexpr (!is_fake_shared) {
556
17
        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
17
        } 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
17
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
17
            _dependency = _shared_state->create_source_dependency(
572
17
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
17
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
17
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
17
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
17
    }
581
582
17
    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
17
    _rows_returned_counter =
587
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
17
    _blocks_returned_counter =
589
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
17
    _output_block_bytes_counter =
591
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
17
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
17
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
17
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
17
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
17
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
17
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
17
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
17
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
17
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
17
    _memory_used_counter =
602
17
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
17
    _common_profile->add_info_string("IsColocate",
604
17
                                     std::to_string(_parent->is_colocated_operator()));
605
17
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
17
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
17
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
17
    return Status::OK();
609
17
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
5.55k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
5.55k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
5.55k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
5.55k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
5.55k
    _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.55k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
5.55k
    _operator_profile->add_child(_common_profile.get(), true);
553
5.55k
    _operator_profile->add_child(_custom_profile.get(), true);
554
5.55k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
5.55k
    if constexpr (!is_fake_shared) {
556
5.55k
        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.55k
        } 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.47k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
5.47k
            _dependency = _shared_state->create_source_dependency(
572
5.47k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
5.47k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
5.47k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
5.47k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
75
        }
580
5.55k
    }
581
582
5.55k
    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.55k
    _rows_returned_counter =
587
5.55k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
5.55k
    _blocks_returned_counter =
589
5.55k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
5.55k
    _output_block_bytes_counter =
591
5.55k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
5.55k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
5.55k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
5.55k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
5.55k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.55k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
5.55k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
5.55k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
5.55k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
5.55k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
5.55k
    _memory_used_counter =
602
5.55k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
5.55k
    _common_profile->add_info_string("IsColocate",
604
5.55k
                                     std::to_string(_parent->is_colocated_operator()));
605
5.55k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
5.55k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
5.55k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
5.55k
    return Status::OK();
609
5.55k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
421
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
421
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
421
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
421
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
421
    _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
421
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
421
    _operator_profile->add_child(_common_profile.get(), true);
553
421
    _operator_profile->add_child(_custom_profile.get(), true);
554
421
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
421
    if constexpr (!is_fake_shared) {
556
421
        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
421
        } 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
420
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
420
            _dependency = _shared_state->create_source_dependency(
572
420
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
420
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
420
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
420
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
1
        }
580
421
    }
581
582
421
    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
421
    _rows_returned_counter =
587
421
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
421
    _blocks_returned_counter =
589
421
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
421
    _output_block_bytes_counter =
591
421
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
421
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
421
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
421
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
421
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
421
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
421
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
421
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
421
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
421
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
421
    _memory_used_counter =
602
421
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
421
    _common_profile->add_info_string("IsColocate",
604
421
                                     std::to_string(_parent->is_colocated_operator()));
605
421
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
421
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
421
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
421
    return Status::OK();
609
421
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
5.01k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
5.01k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
5.01k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
5.01k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
5.01k
    _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.01k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
5.01k
    _operator_profile->add_child(_common_profile.get(), true);
553
5.01k
    _operator_profile->add_child(_custom_profile.get(), true);
554
5.01k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
5.01k
    if constexpr (!is_fake_shared) {
556
5.01k
        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.01k
        } 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
4.35k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
4.35k
            _dependency = _shared_state->create_source_dependency(
572
4.35k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
4.35k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
4.35k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
4.35k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
664
        }
580
5.01k
    }
581
582
5.01k
    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.01k
    _rows_returned_counter =
587
5.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
5.01k
    _blocks_returned_counter =
589
5.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
5.01k
    _output_block_bytes_counter =
591
5.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
5.01k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
5.01k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
5.01k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
5.01k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.01k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
5.01k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
5.01k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
5.01k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
5.01k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
5.01k
    _memory_used_counter =
602
5.01k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
5.01k
    _common_profile->add_info_string("IsColocate",
604
5.01k
                                     std::to_string(_parent->is_colocated_operator()));
605
5.01k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
5.01k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
5.01k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
5.01k
    return Status::OK();
609
5.01k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
599k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
599k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
599k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
599k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
599k
    _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
599k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
599k
    _operator_profile->add_child(_common_profile.get(), true);
553
599k
    _operator_profile->add_child(_custom_profile.get(), true);
554
599k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
599k
    if constexpr (!is_fake_shared) {
556
599k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
584k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
584k
                                    .first.get()
559
584k
                                    ->template cast<SharedStateArg>();
560
561
584k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
584k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
584k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
584k
        } 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
15.4k
        } else {
576
15.4k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
15.4k
                DCHECK(false);
578
15.4k
            }
579
15.4k
        }
580
599k
    }
581
582
599k
    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
599k
    _rows_returned_counter =
587
599k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
599k
    _blocks_returned_counter =
589
599k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
599k
    _output_block_bytes_counter =
591
599k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
599k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
599k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
599k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
599k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
599k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
599k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
599k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
599k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
599k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
599k
    _memory_used_counter =
602
599k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
599k
    _common_profile->add_info_string("IsColocate",
604
599k
                                     std::to_string(_parent->is_colocated_operator()));
605
599k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
599k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
599k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
599k
    return Status::OK();
609
599k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
163
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
163
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
163
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
163
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
163
    _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
163
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
163
    _operator_profile->add_child(_common_profile.get(), true);
553
163
    _operator_profile->add_child(_custom_profile.get(), true);
554
163
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
163
    if constexpr (!is_fake_shared) {
556
163
        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
163
        } 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
163
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
163
            _dependency = _shared_state->create_source_dependency(
572
163
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
163
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
163
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
163
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
163
    }
581
582
163
    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
163
    _rows_returned_counter =
587
163
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
163
    _blocks_returned_counter =
589
163
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
163
    _output_block_bytes_counter =
591
163
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
163
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
163
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
163
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
163
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
163
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
163
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
163
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
163
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
163
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
163
    _memory_used_counter =
602
163
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
163
    _common_profile->add_info_string("IsColocate",
604
163
                                     std::to_string(_parent->is_colocated_operator()));
605
163
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
163
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
163
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
163
    return Status::OK();
609
163
}
610
611
template <typename SharedStateArg>
612
1.96M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
1.96M
    _conjuncts.resize(_parent->_conjuncts.size());
614
1.96M
    _projections.resize(_parent->_projections.size());
615
2.24M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
277k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
277k
    }
618
3.81M
    for (size_t i = 0; i < _projections.size(); i++) {
619
1.84M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
1.84M
    }
621
1.96M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
1.97M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
7.03k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
43.8k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
36.7k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
36.7k
                    state, _intermediate_projections[i][j]));
627
36.7k
        }
628
7.03k
    }
629
1.96M
    return Status::OK();
630
1.96M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
69.5k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
69.5k
    _conjuncts.resize(_parent->_conjuncts.size());
614
69.5k
    _projections.resize(_parent->_projections.size());
615
70.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
1.45k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
1.45k
    }
618
385k
    for (size_t i = 0; i < _projections.size(); i++) {
619
315k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
315k
    }
621
69.5k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
70.2k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
747
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
5.81k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
5.06k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
5.06k
                    state, _intermediate_projections[i][j]));
627
5.06k
        }
628
747
    }
629
69.5k
    return Status::OK();
630
69.5k
}
_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
192k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
192k
    _conjuncts.resize(_parent->_conjuncts.size());
614
192k
    _projections.resize(_parent->_projections.size());
615
192k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
192k
    for (size_t i = 0; i < _projections.size(); i++) {
619
287
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
287
    }
621
192k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
192k
    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
192k
    return Status::OK();
630
192k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
28
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
28
    _conjuncts.resize(_parent->_conjuncts.size());
614
28
    _projections.resize(_parent->_projections.size());
615
28
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
28
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
28
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
28
    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
28
    return Status::OK();
630
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
7.60k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
7.60k
    _conjuncts.resize(_parent->_conjuncts.size());
614
7.60k
    _projections.resize(_parent->_projections.size());
615
7.68k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
87
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
87
    }
618
37.9k
    for (size_t i = 0; i < _projections.size(); i++) {
619
30.3k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
30.3k
    }
621
7.60k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
7.61k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
17
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
147
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
130
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
130
                    state, _intermediate_projections[i][j]));
627
130
        }
628
17
    }
629
7.60k
    return Status::OK();
630
7.60k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
10.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
10.4k
    _conjuncts.resize(_parent->_conjuncts.size());
614
10.4k
    _projections.resize(_parent->_projections.size());
615
11.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
651
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
651
    }
618
29.6k
    for (size_t i = 0; i < _projections.size(); i++) {
619
19.1k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
19.1k
    }
621
10.4k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
10.5k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
93
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
706
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
613
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
613
                    state, _intermediate_projections[i][j]));
627
613
        }
628
93
    }
629
10.4k
    return Status::OK();
630
10.4k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
83.7k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
83.7k
    _conjuncts.resize(_parent->_conjuncts.size());
614
83.7k
    _projections.resize(_parent->_projections.size());
615
85.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
1.55k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
1.55k
    }
618
288k
    for (size_t i = 0; i < _projections.size(); i++) {
619
204k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
204k
    }
621
83.7k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
83.8k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
103
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
648
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
545
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
545
                    state, _intermediate_projections[i][j]));
627
545
        }
628
103
    }
629
83.7k
    return Status::OK();
630
83.7k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
545
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
545
    _conjuncts.resize(_parent->_conjuncts.size());
614
545
    _projections.resize(_parent->_projections.size());
615
552
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
7
    }
618
2.00k
    for (size_t i = 0; i < _projections.size(); i++) {
619
1.46k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
1.46k
    }
621
545
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
545
    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
545
    return Status::OK();
630
545
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
136
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
136
    _conjuncts.resize(_parent->_conjuncts.size());
614
136
    _projections.resize(_parent->_projections.size());
615
136
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
352
    for (size_t i = 0; i < _projections.size(); i++) {
619
216
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
216
    }
621
136
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
136
    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
136
    return Status::OK();
630
136
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
937k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
937k
    _conjuncts.resize(_parent->_conjuncts.size());
614
937k
    _projections.resize(_parent->_projections.size());
615
1.21M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
272k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
272k
    }
618
2.13M
    for (size_t i = 0; i < _projections.size(); i++) {
619
1.19M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
1.19M
    }
621
937k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
943k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
6.07k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
36.4k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
30.4k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
30.4k
                    state, _intermediate_projections[i][j]));
627
30.4k
        }
628
6.07k
    }
629
937k
    return Status::OK();
630
937k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
51.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
51.2k
    _conjuncts.resize(_parent->_conjuncts.size());
614
51.2k
    _projections.resize(_parent->_projections.size());
615
51.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
135k
    for (size_t i = 0; i < _projections.size(); i++) {
619
84.1k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
84.1k
    }
621
51.2k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
51.2k
    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
51.2k
    return Status::OK();
630
51.2k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
17
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
17
    _conjuncts.resize(_parent->_conjuncts.size());
614
17
    _projections.resize(_parent->_projections.size());
615
17
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
17
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
17
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
17
    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
17
    return Status::OK();
630
17
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
5.56k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
5.56k
    _conjuncts.resize(_parent->_conjuncts.size());
614
5.56k
    _projections.resize(_parent->_projections.size());
615
6.37k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
818
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
818
    }
618
5.56k
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
5.56k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
5.56k
    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.56k
    return Status::OK();
630
5.56k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
421
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
421
    _conjuncts.resize(_parent->_conjuncts.size());
614
421
    _projections.resize(_parent->_projections.size());
615
421
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
421
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
421
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
421
    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
421
    return Status::OK();
630
421
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
5.18k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
5.18k
    _conjuncts.resize(_parent->_conjuncts.size());
614
5.18k
    _projections.resize(_parent->_projections.size());
615
5.18k
    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.36k
    for (size_t i = 0; i < _projections.size(); i++) {
619
180
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
180
    }
621
5.18k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
5.18k
    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.18k
    return Status::OK();
630
5.18k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
605k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
605k
    _conjuncts.resize(_parent->_conjuncts.size());
614
605k
    _projections.resize(_parent->_projections.size());
615
605k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
605k
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
605k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
605k
    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
605k
    return Status::OK();
630
605k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
163
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
163
    _conjuncts.resize(_parent->_conjuncts.size());
614
163
    _projections.resize(_parent->_projections.size());
615
170
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
7
    }
618
479
    for (size_t i = 0; i < _projections.size(); i++) {
619
316
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
316
    }
621
163
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
166
    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
163
    return Status::OK();
630
163
}
631
632
template <typename SharedStateArg>
633
3.63k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
3.63k
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
3.63k
    _terminated = true;
638
3.63k
    return Status::OK();
639
3.63k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
139
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
139
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
139
    _terminated = true;
638
139
    return Status::OK();
639
139
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
103
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
103
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
103
    _terminated = true;
638
103
    return Status::OK();
639
103
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
31
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
31
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
31
    _terminated = true;
638
31
    return Status::OK();
639
31
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
134
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
134
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
134
    _terminated = true;
638
134
    return Status::OK();
639
134
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
2.20k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
2.20k
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
2.20k
    _terminated = true;
638
2.20k
    return Status::OK();
639
2.20k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
7
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
7
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
7
    _terminated = true;
638
7
    return Status::OK();
639
7
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
42
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
42
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
42
    _terminated = true;
638
42
    return Status::OK();
639
42
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
461
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
461
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
461
    _terminated = true;
638
461
    return Status::OK();
639
461
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
501
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
501
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
501
    _terminated = true;
638
501
    return Status::OK();
639
501
}
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.19M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
2.19M
    if (_closed) {
644
223k
        return Status::OK();
645
223k
    }
646
1.96M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
1.03M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
1.03M
    }
649
1.96M
    _closed = true;
650
1.96M
    return Status::OK();
651
2.19M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
69.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
69.4k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
69.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
69.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
69.4k
    }
649
69.4k
    _closed = true;
650
69.4k
    return Status::OK();
651
69.4k
}
_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
382k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
382k
    if (_closed) {
644
191k
        return Status::OK();
645
191k
    }
646
191k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
191k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
191k
    }
649
191k
    _closed = true;
650
191k
    return Status::OK();
651
382k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
28
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
28
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
28
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
28
    }
649
28
    _closed = true;
650
28
    return Status::OK();
651
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
7.59k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
7.59k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
7.59k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
7.59k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
7.59k
    }
649
7.59k
    _closed = true;
650
7.59k
    return Status::OK();
651
7.59k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
21.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
21.1k
    if (_closed) {
644
10.6k
        return Status::OK();
645
10.6k
    }
646
10.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
10.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
10.4k
    }
649
10.4k
    _closed = true;
650
10.4k
    return Status::OK();
651
21.1k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
83.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
83.5k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
83.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
83.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
83.5k
    }
649
83.5k
    _closed = true;
650
83.5k
    return Status::OK();
651
83.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
545
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
545
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
545
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
545
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
545
    }
649
545
    _closed = true;
650
545
    return Status::OK();
651
545
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
131
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
131
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
131
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
131
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
131
    }
649
131
    _closed = true;
650
131
    return Status::OK();
651
131
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
952k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
952k
    if (_closed) {
644
14.9k
        return Status::OK();
645
14.9k
    }
646
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
    }
649
937k
    _closed = true;
650
937k
    return Status::OK();
651
952k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
51.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
51.2k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
51.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
51.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
51.2k
    }
649
51.2k
    _closed = true;
650
51.2k
    return Status::OK();
651
51.2k
}
_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
5.51k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
5.51k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
5.51k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
5.51k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
5.51k
    }
649
5.51k
    _closed = true;
650
5.51k
    return Status::OK();
651
5.51k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
637
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
637
    if (_closed) {
644
319
        return Status::OK();
645
319
    }
646
318
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
318
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
318
    }
649
318
    _closed = true;
650
318
    return Status::OK();
651
637
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
10.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
10.4k
    if (_closed) {
644
5.28k
        return Status::OK();
645
5.28k
    }
646
5.16k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
5.16k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
5.16k
    }
649
5.16k
    _closed = true;
650
5.16k
    return Status::OK();
651
10.4k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
606k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
606k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
606k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
606k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
606k
    }
649
606k
    _closed = true;
650
606k
    return Status::OK();
651
606k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
336
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
336
    if (_closed) {
644
182
        return Status::OK();
645
182
    }
646
154
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
154
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
154
    }
649
154
    _closed = true;
650
154
    return Status::OK();
651
336
}
652
653
template <typename SharedState>
654
1.56M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
1.56M
    _operator_profile =
657
1.56M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
1.56M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
1.56M
    _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
1.56M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
1.56M
    _operator_profile->add_child(_common_profile, true);
666
1.56M
    _operator_profile->add_child(_custom_profile, true);
667
668
1.56M
    _operator_profile->set_metadata(_parent->node_id());
669
1.56M
    _wait_for_finish_dependency_timer =
670
1.56M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
1.56M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
1.56M
    if constexpr (!is_fake_shared) {
673
1.04M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
1.04M
            info.shared_state_map.end()) {
675
259k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
242k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
242k
            }
678
259k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
259k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
259k
                                                  ? 0
681
259k
                                                  : info.task_idx]
682
259k
                                  .get();
683
259k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
785k
        } else {
685
785k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
3
                DCHECK(false);
687
3
            }
688
785k
            _shared_state = info.shared_state->template cast<SharedState>();
689
785k
            _dependency = _shared_state->create_sink_dependency(
690
785k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
785k
        }
692
1.04M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
1.04M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
1.04M
    }
695
696
1.56M
    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
1.56M
    _rows_input_counter =
701
1.56M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
1.56M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
1.56M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
1.56M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
1.56M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
1.56M
    _memory_used_counter =
707
1.56M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
1.56M
    _common_profile->add_info_string("IsColocate",
709
1.56M
                                     std::to_string(_parent->is_colocated_operator()));
710
1.56M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
1.56M
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
1.56M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
1.56M
    return Status::OK();
714
1.56M
}
_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.8k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
16.8k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
16.8k
                                                  ? 0
681
16.8k
                                                  : info.task_idx]
682
16.8k
                                  .get();
683
16.8k
            _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
190k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
190k
    _operator_profile =
657
190k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
190k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
190k
    _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
190k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
190k
    _operator_profile->add_child(_common_profile, true);
666
190k
    _operator_profile->add_child(_custom_profile, true);
667
668
190k
    _operator_profile->set_metadata(_parent->node_id());
669
190k
    _wait_for_finish_dependency_timer =
670
190k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
190k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
190k
    if constexpr (!is_fake_shared) {
673
190k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
190k
            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
190k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
190k
            _shared_state = info.shared_state->template cast<SharedState>();
689
190k
            _dependency = _shared_state->create_sink_dependency(
690
190k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
190k
        }
692
190k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
190k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
190k
    }
695
696
190k
    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
190k
    _rows_input_counter =
701
190k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
190k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
190k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
190k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
190k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
190k
    _memory_used_counter =
707
190k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
190k
    _common_profile->add_info_string("IsColocate",
709
190k
                                     std::to_string(_parent->is_colocated_operator()));
710
190k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
190k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
190k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
190k
    return Status::OK();
714
190k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
35
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
35
    _operator_profile =
657
35
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
35
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
35
    _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
35
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
35
    _operator_profile->add_child(_common_profile, true);
666
35
    _operator_profile->add_child(_custom_profile, true);
667
668
35
    _operator_profile->set_metadata(_parent->node_id());
669
35
    _wait_for_finish_dependency_timer =
670
35
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
35
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
35
    if constexpr (!is_fake_shared) {
673
35
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
35
            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
35
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
35
            _shared_state = info.shared_state->template cast<SharedState>();
689
35
            _dependency = _shared_state->create_sink_dependency(
690
35
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
35
        }
692
35
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
35
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
35
    }
695
696
35
    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
35
    _rows_input_counter =
701
35
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
35
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
35
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
35
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
35
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
35
    _memory_used_counter =
707
35
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
35
    _common_profile->add_info_string("IsColocate",
709
35
                                     std::to_string(_parent->is_colocated_operator()));
710
35
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
35
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
35
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
35
    return Status::OK();
714
35
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
7.55k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
7.55k
    _operator_profile =
657
7.55k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
7.55k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
7.55k
    _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.55k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
7.55k
    _operator_profile->add_child(_common_profile, true);
666
7.55k
    _operator_profile->add_child(_custom_profile, true);
667
668
7.55k
    _operator_profile->set_metadata(_parent->node_id());
669
7.55k
    _wait_for_finish_dependency_timer =
670
7.55k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
7.55k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
7.55k
    if constexpr (!is_fake_shared) {
673
7.55k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
7.55k
            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.55k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
7.55k
            _shared_state = info.shared_state->template cast<SharedState>();
689
7.55k
            _dependency = _shared_state->create_sink_dependency(
690
7.55k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
7.55k
        }
692
7.55k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
7.55k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
7.55k
    }
695
696
7.55k
    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.55k
    _rows_input_counter =
701
7.55k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
7.55k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
7.55k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
7.55k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
7.55k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
7.55k
    _memory_used_counter =
707
7.55k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
7.55k
    _common_profile->add_info_string("IsColocate",
709
7.55k
                                     std::to_string(_parent->is_colocated_operator()));
710
7.55k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
7.55k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
7.55k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
7.55k
    return Status::OK();
714
7.55k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
10.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
10.4k
    _operator_profile =
657
10.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
10.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
10.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
10.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
10.4k
    _operator_profile->add_child(_common_profile, true);
666
10.4k
    _operator_profile->add_child(_custom_profile, true);
667
668
10.4k
    _operator_profile->set_metadata(_parent->node_id());
669
10.4k
    _wait_for_finish_dependency_timer =
670
10.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
10.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
10.4k
    if constexpr (!is_fake_shared) {
673
10.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
10.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
10.4k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
10.4k
            _shared_state = info.shared_state->template cast<SharedState>();
689
10.4k
            _dependency = _shared_state->create_sink_dependency(
690
10.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
10.4k
        }
692
10.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
10.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
10.4k
    }
695
696
10.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
10.4k
    _rows_input_counter =
701
10.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
10.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
10.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
10.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
10.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
10.4k
    _memory_used_counter =
707
10.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
10.4k
    _common_profile->add_info_string("IsColocate",
709
10.4k
                                     std::to_string(_parent->is_colocated_operator()));
710
10.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
10.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
10.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
10.4k
    return Status::OK();
714
10.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
83.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
83.4k
    _operator_profile =
657
83.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
83.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
83.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
83.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
83.4k
    _operator_profile->add_child(_common_profile, true);
666
83.4k
    _operator_profile->add_child(_custom_profile, true);
667
668
83.4k
    _operator_profile->set_metadata(_parent->node_id());
669
83.4k
    _wait_for_finish_dependency_timer =
670
83.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
83.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
83.4k
    if constexpr (!is_fake_shared) {
673
83.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
83.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
83.4k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
83.4k
            _shared_state = info.shared_state->template cast<SharedState>();
689
83.4k
            _dependency = _shared_state->create_sink_dependency(
690
83.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
83.4k
        }
692
83.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
83.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
83.4k
    }
695
696
83.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
83.4k
    _rows_input_counter =
701
83.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
83.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
83.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
83.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
83.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
83.4k
    _memory_used_counter =
707
83.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
83.4k
    _common_profile->add_info_string("IsColocate",
709
83.4k
                                     std::to_string(_parent->is_colocated_operator()));
710
83.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
83.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
83.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
83.4k
    return Status::OK();
714
83.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
545
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
545
    _operator_profile =
657
545
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
545
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
545
    _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
545
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
545
    _operator_profile->add_child(_common_profile, true);
666
545
    _operator_profile->add_child(_custom_profile, true);
667
668
545
    _operator_profile->set_metadata(_parent->node_id());
669
545
    _wait_for_finish_dependency_timer =
670
545
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
545
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
545
    if constexpr (!is_fake_shared) {
673
545
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
545
            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
535
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
535
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
535
                                                  ? 0
681
535
                                                  : info.task_idx]
682
535
                                  .get();
683
535
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
535
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
10
            _shared_state = info.shared_state->template cast<SharedState>();
689
10
            _dependency = _shared_state->create_sink_dependency(
690
10
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
10
        }
692
545
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
545
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
545
    }
695
696
545
    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
545
    _rows_input_counter =
701
545
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
545
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
545
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
545
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
545
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
545
    _memory_used_counter =
707
545
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
545
    _common_profile->add_info_string("IsColocate",
709
545
                                     std::to_string(_parent->is_colocated_operator()));
710
545
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
545
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
545
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
545
    return Status::OK();
714
545
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
142
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
142
    _operator_profile =
657
142
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
142
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
142
    _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
142
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
142
    _operator_profile->add_child(_common_profile, true);
666
142
    _operator_profile->add_child(_custom_profile, true);
667
668
142
    _operator_profile->set_metadata(_parent->node_id());
669
142
    _wait_for_finish_dependency_timer =
670
142
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
142
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
142
    if constexpr (!is_fake_shared) {
673
142
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
142
            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
142
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
142
            _shared_state = info.shared_state->template cast<SharedState>();
689
142
            _dependency = _shared_state->create_sink_dependency(
690
142
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
142
        }
692
142
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
142
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
142
    }
695
696
142
    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
142
    _rows_input_counter =
701
142
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
142
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
142
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
142
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
142
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
142
    _memory_used_counter =
707
142
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
142
    _common_profile->add_info_string("IsColocate",
709
142
                                     std::to_string(_parent->is_colocated_operator()));
710
142
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
142
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
142
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
142
    return Status::OK();
714
142
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
515k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
515k
    _operator_profile =
657
515k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
515k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
515k
    _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
515k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
515k
    _operator_profile->add_child(_common_profile, true);
666
515k
    _operator_profile->add_child(_custom_profile, true);
667
668
515k
    _operator_profile->set_metadata(_parent->node_id());
669
515k
    _wait_for_finish_dependency_timer =
670
515k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
515k
    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
515k
    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
515k
    _rows_input_counter =
701
515k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
515k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
515k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
515k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
515k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
515k
    _memory_used_counter =
707
515k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
515k
    _common_profile->add_info_string("IsColocate",
709
515k
                                     std::to_string(_parent->is_colocated_operator()));
710
515k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
515k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
515k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
515k
    return Status::OK();
714
515k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
5.06k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
5.06k
    _operator_profile =
657
5.06k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
5.06k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
5.06k
    _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
5.06k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
5.06k
    _operator_profile->add_child(_common_profile, true);
666
5.06k
    _operator_profile->add_child(_custom_profile, true);
667
668
5.06k
    _operator_profile->set_metadata(_parent->node_id());
669
5.06k
    _wait_for_finish_dependency_timer =
670
5.06k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
5.06k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
5.06k
    if constexpr (!is_fake_shared) {
673
5.06k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
5.06k
            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
5.06k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
5.06k
            _shared_state = info.shared_state->template cast<SharedState>();
689
5.06k
            _dependency = _shared_state->create_sink_dependency(
690
5.06k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
5.06k
        }
692
5.06k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
5.06k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
5.06k
    }
695
696
5.06k
    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
5.06k
    _rows_input_counter =
701
5.06k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
5.06k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
5.06k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
5.06k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
5.06k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
5.06k
    _memory_used_counter =
707
5.06k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
5.06k
    _common_profile->add_info_string("IsColocate",
709
5.06k
                                     std::to_string(_parent->is_colocated_operator()));
710
5.06k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
5.06k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
5.06k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
5.06k
    return Status::OK();
714
5.06k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
421
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
421
    _operator_profile =
657
421
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
421
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
421
    _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
421
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
421
    _operator_profile->add_child(_common_profile, true);
666
421
    _operator_profile->add_child(_custom_profile, true);
667
668
421
    _operator_profile->set_metadata(_parent->node_id());
669
421
    _wait_for_finish_dependency_timer =
670
421
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
421
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
421
    if constexpr (!is_fake_shared) {
673
421
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
421
            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
421
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
421
            _shared_state = info.shared_state->template cast<SharedState>();
689
421
            _dependency = _shared_state->create_sink_dependency(
690
421
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
421
        }
692
421
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
421
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
421
    }
695
696
421
    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
421
    _rows_input_counter =
701
421
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
421
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
421
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
421
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
421
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
421
    _memory_used_counter =
707
421
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
421
    _common_profile->add_info_string("IsColocate",
709
421
                                     std::to_string(_parent->is_colocated_operator()));
710
421
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
421
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
421
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
421
    return Status::OK();
714
421
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
2.25k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
2.25k
    _operator_profile =
657
2.25k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
2.25k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
2.25k
    _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.25k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
2.25k
    _operator_profile->add_child(_common_profile, true);
666
2.25k
    _operator_profile->add_child(_custom_profile, true);
667
668
2.25k
    _operator_profile->set_metadata(_parent->node_id());
669
2.25k
    _wait_for_finish_dependency_timer =
670
2.25k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
2.25k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
2.25k
    if constexpr (!is_fake_shared) {
673
2.25k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
2.25k
            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.25k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
2.25k
            _shared_state = info.shared_state->template cast<SharedState>();
689
2.25k
            _dependency = _shared_state->create_sink_dependency(
690
2.25k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
2.25k
        }
692
2.25k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
2.25k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
2.25k
    }
695
696
2.25k
    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.25k
    _rows_input_counter =
701
2.25k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
2.25k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
2.25k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
2.25k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
2.25k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
2.25k
    _memory_used_counter =
707
2.25k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
2.25k
    _common_profile->add_info_string("IsColocate",
709
2.25k
                                     std::to_string(_parent->is_colocated_operator()));
710
2.25k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
2.25k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
2.25k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
2.25k
    return Status::OK();
714
2.25k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
12.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
12.7k
    _operator_profile =
657
12.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
12.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
12.7k
    _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.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
12.7k
    _operator_profile->add_child(_common_profile, true);
666
12.7k
    _operator_profile->add_child(_custom_profile, true);
667
668
12.7k
    _operator_profile->set_metadata(_parent->node_id());
669
12.7k
    _wait_for_finish_dependency_timer =
670
12.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
12.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
12.7k
    if constexpr (!is_fake_shared) {
673
12.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
12.7k
            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.7k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
12.7k
            _shared_state = info.shared_state->template cast<SharedState>();
689
12.7k
            _dependency = _shared_state->create_sink_dependency(
690
12.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
12.7k
        }
692
12.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
12.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
12.7k
    }
695
696
12.7k
    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.7k
    _rows_input_counter =
701
12.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
12.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
12.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
12.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
12.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
12.7k
    _memory_used_counter =
707
12.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
12.7k
    _common_profile->add_info_string("IsColocate",
709
12.7k
                                     std::to_string(_parent->is_colocated_operator()));
710
12.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
12.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
12.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
12.7k
    return Status::OK();
714
12.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
242k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
242k
    _operator_profile =
657
242k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
242k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
242k
    _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
242k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
242k
    _operator_profile->add_child(_common_profile, true);
666
242k
    _operator_profile->add_child(_custom_profile, true);
667
668
242k
    _operator_profile->set_metadata(_parent->node_id());
669
242k
    _wait_for_finish_dependency_timer =
670
242k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
242k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
242k
    if constexpr (!is_fake_shared) {
673
242k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
242k
            info.shared_state_map.end()) {
675
242k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
242k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
242k
            }
678
242k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
242k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
242k
                                                  ? 0
681
242k
                                                  : info.task_idx]
682
242k
                                  .get();
683
242k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
242k
        } else {
685
3
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
3
                DCHECK(false);
687
3
            }
688
3
            _shared_state = info.shared_state->template cast<SharedState>();
689
3
            _dependency = _shared_state->create_sink_dependency(
690
3
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
3
        }
692
242k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
242k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
242k
    }
695
696
242k
    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
242k
    _rows_input_counter =
701
242k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
242k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
242k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
242k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
242k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
242k
    _memory_used_counter =
707
242k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
242k
    _common_profile->add_info_string("IsColocate",
709
242k
                                     std::to_string(_parent->is_colocated_operator()));
710
242k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
242k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
242k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
242k
    return Status::OK();
714
242k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
372k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
372k
    _operator_profile =
657
372k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
372k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
372k
    _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
372k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
372k
    _operator_profile->add_child(_common_profile, true);
666
372k
    _operator_profile->add_child(_custom_profile, true);
667
668
372k
    _operator_profile->set_metadata(_parent->node_id());
669
372k
    _wait_for_finish_dependency_timer =
670
372k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
372k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
372k
    if constexpr (!is_fake_shared) {
673
372k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
372k
            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
372k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
372k
            _shared_state = info.shared_state->template cast<SharedState>();
689
372k
            _dependency = _shared_state->create_sink_dependency(
690
372k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
372k
        }
692
372k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
372k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
372k
    }
695
696
372k
    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
372k
    _rows_input_counter =
701
372k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
372k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
372k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
372k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
372k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
372k
    _memory_used_counter =
707
372k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
372k
    _common_profile->add_info_string("IsColocate",
709
372k
                                     std::to_string(_parent->is_colocated_operator()));
710
372k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
372k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
372k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
372k
    return Status::OK();
714
372k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
17
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
17
    _operator_profile =
657
17
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
17
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
17
    _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
17
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
17
    _operator_profile->add_child(_common_profile, true);
666
17
    _operator_profile->add_child(_custom_profile, true);
667
668
17
    _operator_profile->set_metadata(_parent->node_id());
669
17
    _wait_for_finish_dependency_timer =
670
17
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
17
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
17
    if constexpr (!is_fake_shared) {
673
17
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
17
            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
17
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
17
            _shared_state = info.shared_state->template cast<SharedState>();
689
17
            _dependency = _shared_state->create_sink_dependency(
690
17
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
17
        }
692
17
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
17
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
17
    }
695
696
17
    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
17
    _rows_input_counter =
701
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
17
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
17
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
17
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
17
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
17
    _memory_used_counter =
707
17
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
17
    _common_profile->add_info_string("IsColocate",
709
17
                                     std::to_string(_parent->is_colocated_operator()));
710
17
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
17
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
17
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
17
    return Status::OK();
714
17
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
326
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
326
    _operator_profile =
657
326
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
326
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
326
    _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
326
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
326
    _operator_profile->add_child(_common_profile, true);
666
326
    _operator_profile->add_child(_custom_profile, true);
667
668
326
    _operator_profile->set_metadata(_parent->node_id());
669
326
    _wait_for_finish_dependency_timer =
670
326
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
326
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
326
    if constexpr (!is_fake_shared) {
673
326
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
326
            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
326
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
326
            _shared_state = info.shared_state->template cast<SharedState>();
689
326
            _dependency = _shared_state->create_sink_dependency(
690
326
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
326
        }
692
326
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
326
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
326
    }
695
696
326
    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
326
    _rows_input_counter =
701
326
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
326
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
326
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
326
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
326
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
326
    _memory_used_counter =
707
326
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
326
    _common_profile->add_info_string("IsColocate",
709
326
                                     std::to_string(_parent->is_colocated_operator()));
710
326
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
326
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
326
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
326
    return Status::OK();
714
326
}
715
716
template <typename SharedState>
717
1.57M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
1.57M
    if (_closed) {
719
2
        return Status::OK();
720
2
    }
721
1.57M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
1.05M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
1.05M
    }
724
1.57M
    _closed = true;
725
1.57M
    return Status::OK();
726
1.57M
}
_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
191k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
191k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
191k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
191k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
191k
    }
724
191k
    _closed = true;
725
191k
    return Status::OK();
726
191k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
26
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
26
    if (_closed) {
719
2
        return Status::OK();
720
2
    }
721
24
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
24
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
24
    }
724
24
    _closed = true;
725
24
    return Status::OK();
726
26
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
7.57k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
7.57k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
7.57k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
7.57k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
7.57k
    }
724
7.57k
    _closed = true;
725
7.57k
    return Status::OK();
726
7.57k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
10.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
10.4k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
10.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
10.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
10.4k
    }
724
10.4k
    _closed = true;
725
10.4k
    return Status::OK();
726
10.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
83.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
83.4k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
83.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
83.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
83.4k
    }
724
83.4k
    _closed = true;
725
83.4k
    return Status::OK();
726
83.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
540
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
540
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
540
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
540
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
540
    }
724
540
    _closed = true;
725
540
    return Status::OK();
726
540
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
131
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
131
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
131
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
131
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
131
    }
724
131
    _closed = true;
725
131
    return Status::OK();
726
131
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
519k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
519k
    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
519k
    _closed = true;
725
519k
    return Status::OK();
726
519k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
5.06k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
5.06k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
5.06k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
5.06k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
5.06k
    }
724
5.06k
    _closed = true;
725
5.06k
    return Status::OK();
726
5.06k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
318
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
318
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
318
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
318
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
318
    }
724
318
    _closed = true;
725
318
    return Status::OK();
726
318
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
2.32k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
2.32k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
2.32k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
2.32k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
2.32k
    }
724
2.32k
    _closed = true;
725
2.32k
    return Status::OK();
726
2.32k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
12.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
12.8k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
12.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
12.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
12.8k
    }
724
12.8k
    _closed = true;
725
12.8k
    return Status::OK();
726
12.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
244k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
244k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
244k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
244k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
244k
    }
724
244k
    _closed = true;
725
244k
    return Status::OK();
726
244k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
375k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
375k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
375k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
375k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
375k
    }
724
375k
    _closed = true;
725
375k
    return Status::OK();
726
375k
}
_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
326
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
326
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
326
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
326
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
326
    }
724
326
    _closed = true;
725
326
    return Status::OK();
726
326
}
727
728
template <typename LocalStateType>
729
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
730
3.07k
                                                          bool* eos) {
731
3.07k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
732
3.07k
    return pull(state, block, eos);
733
3.07k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
730
32
                                                          bool* eos) {
731
32
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
732
32
    return pull(state, block, eos);
733
32
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
730
3.04k
                                                          bool* eos) {
731
3.04k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
732
3.04k
    return pull(state, block, eos);
733
3.04k
}
734
735
template <typename LocalStateType>
736
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
621k
                                                         bool* eos) {
738
621k
    auto& local_state = get_local_state(state);
739
621k
    if (need_more_input_data(state)) {
740
591k
        local_state._child_block->clear_column_data(
741
591k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
591k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
591k
                state, local_state._child_block.get(), &local_state._child_eos));
744
591k
        *eos = local_state._child_eos;
745
591k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
68.1k
            return Status::OK();
747
68.1k
        }
748
522k
        {
749
522k
            SCOPED_TIMER(local_state.exec_time_counter());
750
522k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
522k
        }
752
522k
    }
753
754
553k
    if (!need_more_input_data(state)) {
755
514k
        SCOPED_TIMER(local_state.exec_time_counter());
756
514k
        bool new_eos = false;
757
514k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
514k
        if (new_eos) {
759
440k
            *eos = true;
760
440k
        } else if (!need_more_input_data(state)) {
761
23.5k
            *eos = false;
762
23.5k
        }
763
514k
    }
764
553k
    return Status::OK();
765
553k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
135k
                                                         bool* eos) {
738
135k
    auto& local_state = get_local_state(state);
739
135k
    if (need_more_input_data(state)) {
740
118k
        local_state._child_block->clear_column_data(
741
118k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
118k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
118k
                state, local_state._child_block.get(), &local_state._child_eos));
744
118k
        *eos = local_state._child_eos;
745
118k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
37.9k
            return Status::OK();
747
37.9k
        }
748
80.9k
        {
749
80.9k
            SCOPED_TIMER(local_state.exec_time_counter());
750
80.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
80.9k
        }
752
80.9k
    }
753
754
98.0k
    if (!need_more_input_data(state)) {
755
98.0k
        SCOPED_TIMER(local_state.exec_time_counter());
756
98.0k
        bool new_eos = false;
757
98.0k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
98.0k
        if (new_eos) {
759
45.1k
            *eos = true;
760
52.8k
        } else if (!need_more_input_data(state)) {
761
9.24k
            *eos = false;
762
9.24k
        }
763
98.0k
    }
764
98.0k
    return Status::OK();
765
98.0k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.31k
                                                         bool* eos) {
738
4.31k
    auto& local_state = get_local_state(state);
739
4.31k
    if (need_more_input_data(state)) {
740
2.42k
        local_state._child_block->clear_column_data(
741
2.42k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
2.42k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
2.42k
                state, local_state._child_block.get(), &local_state._child_eos));
744
2.42k
        *eos = local_state._child_eos;
745
2.42k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
463
            return Status::OK();
747
463
        }
748
1.96k
        {
749
1.96k
            SCOPED_TIMER(local_state.exec_time_counter());
750
1.96k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
1.96k
        }
752
1.96k
    }
753
754
3.85k
    if (!need_more_input_data(state)) {
755
3.85k
        SCOPED_TIMER(local_state.exec_time_counter());
756
3.85k
        bool new_eos = false;
757
3.85k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
3.85k
        if (new_eos) {
759
1.43k
            *eos = true;
760
2.41k
        } else if (!need_more_input_data(state)) {
761
1.87k
            *eos = false;
762
1.87k
        }
763
3.85k
    }
764
3.84k
    return Status::OK();
765
3.84k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
1.77k
                                                         bool* eos) {
738
1.77k
    auto& local_state = get_local_state(state);
739
1.77k
    if (need_more_input_data(state)) {
740
1.77k
        local_state._child_block->clear_column_data(
741
1.77k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
1.77k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
1.77k
                state, local_state._child_block.get(), &local_state._child_eos));
744
1.77k
        *eos = local_state._child_eos;
745
1.77k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
684
            return Status::OK();
747
684
        }
748
1.08k
        {
749
1.08k
            SCOPED_TIMER(local_state.exec_time_counter());
750
1.08k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
1.08k
        }
752
1.08k
    }
753
754
1.08k
    if (!need_more_input_data(state)) {
755
1.08k
        SCOPED_TIMER(local_state.exec_time_counter());
756
1.08k
        bool new_eos = false;
757
1.08k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
1.08k
        if (new_eos) {
759
715
            *eos = true;
760
715
        } else if (!need_more_input_data(state)) {
761
0
            *eos = false;
762
0
        }
763
1.08k
    }
764
1.08k
    return Status::OK();
765
1.08k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
14.1k
                                                         bool* eos) {
738
14.1k
    auto& local_state = get_local_state(state);
739
14.1k
    if (need_more_input_data(state)) {
740
14.0k
        local_state._child_block->clear_column_data(
741
14.0k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
14.0k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
14.0k
                state, local_state._child_block.get(), &local_state._child_eos));
744
14.0k
        *eos = local_state._child_eos;
745
14.0k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
2.04k
            return Status::OK();
747
2.04k
        }
748
12.0k
        {
749
12.0k
            SCOPED_TIMER(local_state.exec_time_counter());
750
12.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
12.0k
        }
752
12.0k
    }
753
754
12.0k
    if (!need_more_input_data(state)) {
755
5.40k
        SCOPED_TIMER(local_state.exec_time_counter());
756
5.40k
        bool new_eos = false;
757
5.40k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
5.40k
        if (new_eos) {
759
5.27k
            *eos = true;
760
5.27k
        } else if (!need_more_input_data(state)) {
761
16
            *eos = false;
762
16
        }
763
5.40k
    }
764
12.0k
    return Status::OK();
765
12.0k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
435k
                                                         bool* eos) {
738
435k
    auto& local_state = get_local_state(state);
739
436k
    if (need_more_input_data(state)) {
740
436k
        local_state._child_block->clear_column_data(
741
436k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
436k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
436k
                state, local_state._child_block.get(), &local_state._child_eos));
744
436k
        *eos = local_state._child_eos;
745
436k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
26.1k
            return Status::OK();
747
26.1k
        }
748
410k
        {
749
410k
            SCOPED_TIMER(local_state.exec_time_counter());
750
410k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
410k
        }
752
410k
    }
753
754
409k
    if (!need_more_input_data(state)) {
755
377k
        SCOPED_TIMER(local_state.exec_time_counter());
756
377k
        bool new_eos = false;
757
377k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
377k
        if (new_eos) {
759
376k
            *eos = true;
760
376k
        } else if (!need_more_input_data(state)) {
761
0
            *eos = false;
762
0
        }
763
377k
    }
764
409k
    return Status::OK();
765
409k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
23.7k
                                                         bool* eos) {
738
23.7k
    auto& local_state = get_local_state(state);
739
23.7k
    if (need_more_input_data(state)) {
740
11.6k
        local_state._child_block->clear_column_data(
741
11.6k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
11.6k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
11.6k
                state, local_state._child_block.get(), &local_state._child_eos));
744
11.6k
        *eos = local_state._child_eos;
745
11.6k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
692
            return Status::OK();
747
692
        }
748
10.9k
        {
749
10.9k
            SCOPED_TIMER(local_state.exec_time_counter());
750
10.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
10.9k
        }
752
10.9k
    }
753
754
23.0k
    if (!need_more_input_data(state)) {
755
22.4k
        SCOPED_TIMER(local_state.exec_time_counter());
756
22.4k
        bool new_eos = false;
757
22.4k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
22.4k
        if (new_eos) {
759
7.57k
            *eos = true;
760
14.8k
        } else if (!need_more_input_data(state)) {
761
12.0k
            *eos = false;
762
12.0k
        }
763
22.4k
    }
764
23.0k
    return Status::OK();
765
23.0k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
6.02k
                                                         bool* eos) {
738
6.02k
    auto& local_state = get_local_state(state);
739
6.02k
    if (need_more_input_data(state)) {
740
5.66k
        local_state._child_block->clear_column_data(
741
5.66k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
5.66k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
5.66k
                state, local_state._child_block.get(), &local_state._child_eos));
744
5.66k
        *eos = local_state._child_eos;
745
5.66k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
164
            return Status::OK();
747
164
        }
748
5.49k
        {
749
5.49k
            SCOPED_TIMER(local_state.exec_time_counter());
750
5.49k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
5.49k
        }
752
5.49k
    }
753
754
5.86k
    if (!need_more_input_data(state)) {
755
5.86k
        SCOPED_TIMER(local_state.exec_time_counter());
756
5.86k
        bool new_eos = false;
757
5.86k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
5.86k
        if (new_eos) {
759
3.85k
            *eos = true;
760
3.85k
        } else if (!need_more_input_data(state)) {
761
366
            *eos = false;
762
366
        }
763
5.86k
    }
764
5.85k
    return Status::OK();
765
5.85k
}
766
767
template <typename Writer, typename Parent>
768
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
769
41.1k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
41.1k
    RETURN_IF_ERROR(Base::init(state, info));
771
41.1k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
41.1k
                                                         "AsyncWriterDependency", true);
773
41.1k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
41.1k
                             _finish_dependency));
775
776
41.1k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
41.1k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
41.1k
    return Status::OK();
779
41.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
361
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
361
    RETURN_IF_ERROR(Base::init(state, info));
771
361
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
361
                                                         "AsyncWriterDependency", true);
773
361
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
361
                             _finish_dependency));
775
776
361
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
361
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
361
    return Status::OK();
779
361
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
40.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
40.7k
    RETURN_IF_ERROR(Base::init(state, info));
771
40.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
40.7k
                                                         "AsyncWriterDependency", true);
773
40.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
40.7k
                             _finish_dependency));
775
776
40.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
40.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
40.7k
    return Status::OK();
779
40.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
56
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
56
    RETURN_IF_ERROR(Base::init(state, info));
771
56
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
56
                                                         "AsyncWriterDependency", true);
773
56
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
56
                             _finish_dependency));
775
776
56
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
56
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
56
    return Status::OK();
779
56
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
780
781
template <typename Writer, typename Parent>
782
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
783
41.4k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
41.4k
    RETURN_IF_ERROR(Base::open(state));
785
41.4k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
322k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
281k
        RETURN_IF_ERROR(
788
281k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
281k
    }
790
41.4k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
41.4k
    return Status::OK();
792
41.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
361
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
361
    RETURN_IF_ERROR(Base::open(state));
785
361
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
1.86k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
1.50k
        RETURN_IF_ERROR(
788
1.50k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
1.50k
    }
790
361
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
361
    return Status::OK();
792
361
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
41.0k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
41.0k
    RETURN_IF_ERROR(Base::open(state));
785
41.0k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
320k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
279k
        RETURN_IF_ERROR(
788
279k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
279k
    }
790
41.0k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
41.0k
    return Status::OK();
792
41.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
56
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
56
    RETURN_IF_ERROR(Base::open(state));
785
56
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
1.00k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
952
        RETURN_IF_ERROR(
788
952
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
952
    }
790
56
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
56
    return Status::OK();
792
56
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
793
794
template <typename Writer, typename Parent>
795
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
796
55.8k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
55.8k
    return _writer->sink(block, eos);
798
55.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
1.46k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
1.46k
    return _writer->sink(block, eos);
798
1.46k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
54.3k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
54.3k
    return _writer->sink(block, eos);
798
54.3k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
56
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
56
    return _writer->sink(block, eos);
798
56
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
799
800
template <typename Writer, typename Parent>
801
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
802
41.4k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
41.4k
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
41.4k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
41.4k
    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
41.4k
    if (_writer) {
810
41.4k
        Status st = _writer->get_writer_status();
811
41.4k
        if (exec_status.ok()) {
812
41.3k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
41.3k
                                                       : Status::Cancelled("force close"));
814
41.3k
        } else {
815
117
            _writer->force_close(exec_status);
816
117
        }
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
41.4k
        RETURN_IF_ERROR(st);
821
41.4k
    }
822
41.4k
    return Base::close(state, exec_status);
823
41.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
349
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
349
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
349
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
349
    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
349
    if (_writer) {
810
349
        Status st = _writer->get_writer_status();
811
349
        if (exec_status.ok()) {
812
349
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
349
                                                       : Status::Cancelled("force close"));
814
349
        } 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
349
        RETURN_IF_ERROR(st);
821
349
    }
822
349
    return Base::close(state, exec_status);
823
349
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
41.0k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
41.0k
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
41.0k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
41.0k
    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
41.0k
    if (_writer) {
810
41.0k
        Status st = _writer->get_writer_status();
811
41.0k
        if (exec_status.ok()) {
812
40.9k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
40.9k
                                                       : Status::Cancelled("force close"));
814
40.9k
        } else {
815
117
            _writer->force_close(exec_status);
816
117
        }
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
41.0k
        RETURN_IF_ERROR(st);
821
41.0k
    }
822
41.0k
    return Base::close(state, exec_status);
823
41.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
56
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
56
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
56
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
56
    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
56
    if (_writer) {
810
56
        Status st = _writer->get_writer_status();
811
56
        if (exec_status.ok()) {
812
56
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
56
                                                       : Status::Cancelled("force close"));
814
56
        } 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
56
        RETURN_IF_ERROR(st);
821
56
    }
822
56
    return Base::close(state, exec_status);
823
56
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
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