Coverage Report

Created: 2026-04-15 12:28

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