Coverage Report

Created: 2026-04-17 11:34

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