Coverage Report

Created: 2026-03-23 09:24

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