Coverage Report

Created: 2026-03-25 10:50

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.07M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
2.07M
    if (_parent->nereids_id() == -1) {
118
1.05M
        return fmt::format("(id={})", _parent->node_id());
119
1.05M
    } else {
120
1.01M
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
1.01M
    }
122
2.07M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
132k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
132k
    if (_parent->nereids_id() == -1) {
118
0
        return fmt::format("(id={})", _parent->node_id());
119
132k
    } else {
120
132k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
132k
    }
122
132k
}
_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
190k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
190k
    if (_parent->nereids_id() == -1) {
118
12
        return fmt::format("(id={})", _parent->node_id());
119
190k
    } else {
120
190k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
190k
    }
122
190k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
28
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
28
    if (_parent->nereids_id() == -1) {
118
0
        return fmt::format("(id={})", _parent->node_id());
119
28
    } else {
120
28
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
28
    }
122
28
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
7.04k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
7.04k
    if (_parent->nereids_id() == -1) {
118
0
        return fmt::format("(id={})", _parent->node_id());
119
7.04k
    } else {
120
7.04k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
7.04k
    }
122
7.04k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
9.65k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
9.65k
    if (_parent->nereids_id() == -1) {
118
9
        return fmt::format("(id={})", _parent->node_id());
119
9.64k
    } else {
120
9.64k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
9.64k
    }
122
9.65k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
119k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
119k
    if (_parent->nereids_id() == -1) {
118
27
        return fmt::format("(id={})", _parent->node_id());
119
119k
    } else {
120
119k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
119k
    }
122
119k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
622
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
622
    if (_parent->nereids_id() == -1) {
118
0
        return fmt::format("(id={})", _parent->node_id());
119
622
    } else {
120
622
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
622
    }
122
622
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
923k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
923k
    if (_parent->nereids_id() == -1) {
118
424k
        return fmt::format("(id={})", _parent->node_id());
119
499k
    } else {
120
499k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
499k
    }
122
923k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
51.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
51.4k
    if (_parent->nereids_id() == -1) {
118
2
        return fmt::format("(id={})", _parent->node_id());
119
51.4k
    } else {
120
51.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
51.4k
    }
122
51.4k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
111
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
111
    if (_parent->nereids_id() == -1) {
118
111
        return fmt::format("(id={})", _parent->node_id());
119
111
    } else {
120
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
0
    }
122
111
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
7.94k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
7.94k
    if (_parent->nereids_id() == -1) {
118
7.94k
        return fmt::format("(id={})", _parent->node_id());
119
7.94k
    } else {
120
2
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
2
    }
122
7.94k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
410
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
410
    if (_parent->nereids_id() == -1) {
118
102
        return fmt::format("(id={})", _parent->node_id());
119
308
    } else {
120
308
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
308
    }
122
410
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
5.14k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
5.14k
    if (_parent->nereids_id() == -1) {
118
12
        return fmt::format("(id={})", _parent->node_id());
119
5.13k
    } else {
120
5.13k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
5.13k
    }
122
5.14k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
116
625k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
117
625k
    if (_parent->nereids_id() == -1) {
118
624k
        return fmt::format("(id={})", _parent->node_id());
119
624k
    } else {
120
780
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
121
780
    }
122
625k
}
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.26M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
1.26M
    if (_parent->nereids_id() == -1) {
127
741k
        return fmt::format("(id={})", _parent->node_id());
128
741k
    } else {
129
523k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
523k
    }
131
1.26M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
182k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
182k
    if (_parent->nereids_id() == -1) {
127
0
        return fmt::format("(id={})", _parent->node_id());
128
182k
    } else {
129
182k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
182k
    }
131
182k
}
_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
193k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
193k
    if (_parent->nereids_id() == -1) {
127
9
        return fmt::format("(id={})", _parent->node_id());
128
193k
    } else {
129
193k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
193k
    }
131
193k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
34
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
34
    if (_parent->nereids_id() == -1) {
127
0
        return fmt::format("(id={})", _parent->node_id());
128
34
    } else {
129
34
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
34
    }
131
34
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
7.35k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
7.35k
    if (_parent->nereids_id() == -1) {
127
0
        return fmt::format("(id={})", _parent->node_id());
128
7.35k
    } else {
129
7.35k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
7.35k
    }
131
7.35k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
9.73k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
9.73k
    if (_parent->nereids_id() == -1) {
127
9
        return fmt::format("(id={})", _parent->node_id());
128
9.72k
    } else {
129
9.72k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
9.72k
    }
131
9.73k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
120k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
120k
    if (_parent->nereids_id() == -1) {
127
27
        return fmt::format("(id={})", _parent->node_id());
128
120k
    } else {
129
120k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
120k
    }
131
120k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
632
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
632
    if (_parent->nereids_id() == -1) {
127
0
        return fmt::format("(id={})", _parent->node_id());
128
632
    } else {
129
632
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
632
    }
131
632
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
18
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
18
    if (_parent->nereids_id() == -1) {
127
18
        return fmt::format("(id={})", _parent->node_id());
128
18
    } else {
129
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
0
    }
131
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
8.49k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
8.49k
    if (_parent->nereids_id() == -1) {
127
3
        return fmt::format("(id={})", _parent->node_id());
128
8.48k
    } else {
129
8.48k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
8.48k
    }
131
8.49k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
418
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
418
    if (_parent->nereids_id() == -1) {
127
102
        return fmt::format("(id={})", _parent->node_id());
128
316
    } else {
129
316
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
316
    }
131
418
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
12.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
12.6k
    if (_parent->nereids_id() == -1) {
127
12.6k
        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
12.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
294k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
294k
    if (_parent->nereids_id() == -1) {
127
294k
        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
294k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
434k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
434k
    if (_parent->nereids_id() == -1) {
127
434k
        return fmt::format("(id={})", _parent->node_id());
128
434k
    } else {
129
76
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
76
    }
131
434k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
125
111
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
126
111
    if (_parent->nereids_id() == -1) {
127
111
        return fmt::format("(id={})", _parent->node_id());
128
111
    } else {
129
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
130
0
    }
131
111
}
_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.4k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
31.4k
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
31.4k
    _terminated = true;
139
31.4k
    return Status::OK();
140
31.4k
}
_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
1.24k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
1.24k
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
1.24k
    _terminated = true;
139
1.24k
    return Status::OK();
140
1.24k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
134
11
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
11
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
11
    _terminated = true;
139
11
    return Status::OK();
140
11
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
134
3.53k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
3.53k
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
3.53k
    _terminated = true;
139
3.53k
    return Status::OK();
140
3.53k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_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_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
134
2.24k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
2.24k
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
2.24k
    _terminated = true;
139
2.24k
    return Status::OK();
140
2.24k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
134
13
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
13
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
13
    _terminated = true;
139
13
    return Status::OK();
140
13
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
134
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
1
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
1
    _terminated = true;
139
1
    return Status::OK();
140
1
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
134
36
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
36
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
36
    _terminated = true;
139
36
    return Status::OK();
140
36
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
134
152
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
152
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
152
    _terminated = true;
139
152
    return Status::OK();
140
152
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
134
137
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
135
137
    if (_terminated) {
136
0
        return Status::OK();
137
0
    }
138
137
    _terminated = true;
139
137
    return Status::OK();
140
137
}
141
142
656k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
143
656k
    return _child && _child->is_serial_operator() && !is_source()
144
656k
                   ? DataDistribution(ExchangeType::PASSTHROUGH)
145
656k
                   : DataDistribution(ExchangeType::NOOP);
146
656k
}
147
148
79.1k
const RowDescriptor& OperatorBase::row_desc() const {
149
79.1k
    return _child->row_desc();
150
79.1k
}
151
152
template <typename SharedStateArg>
153
43.4k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
154
43.4k
    fmt::memory_buffer debug_string_buffer;
155
43.4k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
156
43.4k
    return fmt::to_string(debug_string_buffer);
157
43.4k
}
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
43.3k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
154
43.3k
    fmt::memory_buffer debug_string_buffer;
155
43.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
156
43.3k
    return fmt::to_string(debug_string_buffer);
157
43.3k
}
_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
43.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
161
43.3k
    fmt::memory_buffer debug_string_buffer;
162
43.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
163
43.3k
    return fmt::to_string(debug_string_buffer);
164
43.3k
}
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
43.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
161
43.3k
    fmt::memory_buffer debug_string_buffer;
162
43.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
163
43.3k
    return fmt::to_string(debug_string_buffer);
164
43.3k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
165
166
43.4k
std::string OperatorXBase::debug_string(int indentation_level) const {
167
43.4k
    fmt::memory_buffer debug_string_buffer;
168
43.4k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
169
43.4k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
170
43.4k
                   _is_serial_operator);
171
43.4k
    return fmt::to_string(debug_string_buffer);
172
43.4k
}
173
174
43.3k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
175
43.3k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
176
43.3k
}
177
178
581k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
179
581k
    std::string node_name = print_plan_node_type(tnode.node_type);
180
581k
    _nereids_id = tnode.nereids_id;
181
581k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
182
2.89k
        if (!tnode.__isset.output_tuple_id) {
183
0
            return Status::InternalError("no final output tuple id");
184
0
        }
185
2.89k
        if (tnode.intermediate_output_tuple_id_list.size() !=
186
2.89k
            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
2.89k
    }
194
581k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
195
581k
    _op_name = substr + "_OPERATOR";
196
197
581k
    if (tnode.__isset.vconjunct) {
198
0
        return Status::InternalError("vconjunct is not supported yet");
199
581k
    } else if (tnode.__isset.conjuncts) {
200
260k
        for (const auto& conjunct : tnode.conjuncts) {
201
260k
            VExprContextSPtr context;
202
260k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
203
260k
            _conjuncts.emplace_back(context);
204
260k
        }
205
88.5k
    }
206
207
    // create the projections expr
208
581k
    if (tnode.__isset.projections) {
209
243k
        DCHECK(tnode.__isset.output_tuple_id);
210
243k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
211
243k
    }
212
581k
    if (!tnode.intermediate_projections_list.empty()) {
213
2.89k
        DCHECK(tnode.__isset.projections) << "no final projections";
214
2.89k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
215
3.79k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
216
3.79k
            VExprContextSPtrs projections;
217
3.79k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
218
3.79k
            _intermediate_projections.push_back(projections);
219
3.79k
        }
220
2.89k
    }
221
581k
    return Status::OK();
222
581k
}
223
224
609k
Status OperatorXBase::prepare(RuntimeState* state) {
225
609k
    for (auto& conjunct : _conjuncts) {
226
260k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
227
260k
    }
228
609k
    if (state->enable_adjust_conjunct_order_by_cost()) {
229
559k
        std::ranges::sort(_conjuncts, [](const auto& a, const auto& b) {
230
342k
            return a->execute_cost() < b->execute_cost();
231
342k
        });
232
559k
    };
233
234
612k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
235
3.79k
        RETURN_IF_ERROR(
236
3.79k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
237
3.79k
    }
238
609k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
239
240
609k
    if (has_output_row_desc()) {
241
243k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
242
243k
    }
243
244
609k
    for (auto& conjunct : _conjuncts) {
245
260k
        RETURN_IF_ERROR(conjunct->open(state));
246
260k
    }
247
609k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
248
609k
    for (auto& projections : _intermediate_projections) {
249
3.79k
        RETURN_IF_ERROR(VExpr::open(projections, state));
250
3.79k
    }
251
609k
    if (_child && !is_source()) {
252
137k
        RETURN_IF_ERROR(_child->prepare(state));
253
137k
    }
254
255
609k
    if (VExpr::contains_blockable_function(_conjuncts) ||
256
609k
        VExpr::contains_blockable_function(_projections)) {
257
0
        _blockable = true;
258
0
    }
259
260
609k
    return Status::OK();
261
609k
}
262
263
8.42k
Status OperatorXBase::terminate(RuntimeState* state) {
264
8.42k
    if (_child && !is_source()) {
265
1.03k
        RETURN_IF_ERROR(_child->terminate(state));
266
1.03k
    }
267
8.42k
    auto result = state->get_local_state_result(operator_id());
268
8.42k
    if (!result) {
269
0
        return result.error();
270
0
    }
271
8.42k
    return result.value()->terminate(state);
272
8.42k
}
273
274
6.08M
Status OperatorXBase::close(RuntimeState* state) {
275
6.08M
    if (_child && !is_source()) {
276
1.31M
        RETURN_IF_ERROR(_child->close(state));
277
1.31M
    }
278
6.08M
    auto result = state->get_local_state_result(operator_id());
279
6.08M
    if (!result) {
280
0
        return result.error();
281
0
    }
282
6.08M
    return result.value()->close(state);
283
6.08M
}
284
285
30.4M
void PipelineXLocalStateBase::clear_origin_block() {
286
30.4M
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
287
30.4M
}
288
289
30.7M
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
290
30.7M
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
291
292
30.7M
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
293
30.7M
    return Status::OK();
294
30.7M
}
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
30.4M
                                     Block* output_block) const {
303
30.4M
    auto* local_state = state->get_local_state(operator_id());
304
30.4M
    SCOPED_TIMER(local_state->exec_time_counter());
305
30.4M
    SCOPED_TIMER(local_state->_projection_timer);
306
30.4M
    const size_t rows = origin_block->rows();
307
30.4M
    if (rows == 0) {
308
30.3M
        return Status::OK();
309
30.3M
    }
310
110k
    Block input_block = *origin_block;
311
312
110k
    size_t bytes_usage = 0;
313
110k
    ColumnsWithTypeAndName new_columns;
314
110k
    for (const auto& projections : local_state->_intermediate_projections) {
315
1.01k
        if (projections.empty()) {
316
0
            return Status::InternalError("meet empty intermediate projection, node id: {}",
317
0
                                         node_id());
318
0
        }
319
1.01k
        new_columns.resize(projections.size());
320
7.30k
        for (int i = 0; i < projections.size(); i++) {
321
6.28k
            RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
322
6.28k
            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
6.28k
        }
330
1.01k
        Block tmp_block {new_columns};
331
1.01k
        bytes_usage += tmp_block.allocated_bytes();
332
1.01k
        input_block.swap(tmp_block);
333
1.01k
    }
334
335
110k
    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
598k
    auto insert_column_datas = [&](auto& to, ColumnPtr& from, size_t rows) {
342
598k
        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
598k
        } else {
352
598k
            if (_keep_origin || !from->is_exclusive()) {
353
591k
                to->insert_range_from(*from, 0, rows);
354
591k
                bytes_usage += from->allocated_bytes();
355
591k
            } else {
356
6.68k
                to = from->assume_mutable();
357
6.68k
            }
358
598k
        }
359
598k
    };
360
361
110k
    MutableBlock mutable_block =
362
110k
            VectorizedUtils::build_mutable_mem_reuse_block(output_block, *_output_row_descriptor);
363
110k
    if (rows != 0) {
364
110k
        auto& mutable_columns = mutable_block.mutable_columns();
365
110k
        const size_t origin_columns_count = input_block.columns();
366
110k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
367
709k
        for (int i = 0; i < mutable_columns.size(); ++i) {
368
598k
            auto result_column_id = -1;
369
598k
            ColumnPtr column_ptr;
370
598k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
371
598k
            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
598k
            column_ptr = column_ptr->convert_to_full_column_if_const();
378
598k
            if (result_column_id >= origin_columns_count) {
379
598k
                bytes_usage += column_ptr->allocated_bytes();
380
598k
            }
381
598k
            insert_column_datas(mutable_columns[i], column_ptr, rows);
382
598k
        }
383
110k
        DCHECK(mutable_block.rows() == rows);
384
110k
        output_block->set_columns(std::move(mutable_columns));
385
110k
    }
386
387
110k
    local_state->_estimate_memory_usage += bytes_usage;
388
389
110k
    return Status::OK();
390
110k
}
391
392
34.0M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
393
34.0M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
394
34.0M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
395
34.0M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
396
34.0M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
397
34.0M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
398
34.0M
            if (_debug_point_count++ % 2 == 0) {
399
34.0M
                return Status::OK();
400
34.0M
            }
401
34.0M
        }
402
34.0M
    });
403
404
34.0M
    Status status;
405
34.0M
    auto* local_state = state->get_local_state(operator_id());
406
34.0M
    Defer defer([&]() {
407
34.0M
        if (status.ok()) {
408
34.0M
            if (auto rows = block->rows()) {
409
699k
                COUNTER_UPDATE(local_state->_rows_returned_counter, rows);
410
699k
                COUNTER_UPDATE(local_state->_blocks_returned_counter, 1);
411
699k
            }
412
34.0M
        }
413
34.0M
    });
414
34.0M
    if (_output_row_descriptor) {
415
30.4M
        local_state->clear_origin_block();
416
30.4M
        status = get_block(state, &local_state->_origin_block, eos);
417
30.4M
        if (UNLIKELY(!status.ok())) {
418
13
            return status;
419
13
        }
420
30.4M
        status = do_projections(state, &local_state->_origin_block, block);
421
30.4M
        return status;
422
30.4M
    }
423
3.54M
    status = get_block(state, block, eos);
424
3.54M
    RETURN_IF_ERROR(block->check_type_and_column());
425
3.54M
    return status;
426
3.54M
}
427
428
32.5M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
429
32.5M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
430
1.50k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
431
1.50k
        *eos = true;
432
1.50k
    }
433
434
32.5M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
435
32.5M
        auto op_name = to_lower(_parent->_op_name);
436
32.5M
        auto arg_op_name = dp->param<std::string>("op_name");
437
32.5M
        arg_op_name = to_lower(arg_op_name);
438
439
32.5M
        if (op_name == arg_op_name) {
440
32.5M
            *eos = true;
441
32.5M
        }
442
32.5M
    });
443
444
32.5M
    if (auto rows = block->rows()) {
445
631k
        _num_rows_returned += rows;
446
631k
    }
447
32.5M
}
448
449
31.3k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
450
31.3k
    auto result = state->get_sink_local_state_result();
451
31.3k
    if (!result) {
452
0
        return result.error();
453
0
    }
454
31.3k
    return result.value()->terminate(state);
455
31.3k
}
456
457
43.4k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
458
43.4k
    fmt::memory_buffer debug_string_buffer;
459
460
43.4k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
461
43.4k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
462
43.4k
    return fmt::to_string(debug_string_buffer);
463
43.4k
}
464
465
43.3k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
466
43.3k
    return state->get_sink_local_state()->debug_string(indentation_level);
467
43.3k
}
468
469
347k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
470
347k
    std::string op_name = "UNKNOWN_SINK";
471
347k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
472
473
348k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
474
348k
        op_name = it->second;
475
348k
    }
476
347k
    _name = op_name + "_OPERATOR";
477
347k
    return Status::OK();
478
347k
}
479
480
169k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
481
169k
    std::string op_name = print_plan_node_type(tnode.node_type);
482
169k
    _nereids_id = tnode.nereids_id;
483
169k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
484
169k
    _name = substr + "_SINK_OPERATOR";
485
169k
    return Status::OK();
486
169k
}
487
488
template <typename LocalStateType>
489
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
490
1.84M
                                                            LocalSinkStateInfo& info) {
491
1.84M
    auto local_state = LocalStateType::create_unique(this, state);
492
1.84M
    RETURN_IF_ERROR(local_state->init(state, info));
493
1.84M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
1.84M
    return Status::OK();
495
1.84M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
182k
                                                            LocalSinkStateInfo& info) {
491
182k
    auto local_state = LocalStateType::create_unique(this, state);
492
182k
    RETURN_IF_ERROR(local_state->init(state, info));
493
182k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
182k
    return Status::OK();
495
182k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
367k
                                                            LocalSinkStateInfo& info) {
491
367k
    auto local_state = LocalStateType::create_unique(this, state);
492
367k
    RETURN_IF_ERROR(local_state->init(state, info));
493
367k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
367k
    return Status::OK();
495
367k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_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
361
                                                            LocalSinkStateInfo& info) {
491
361
    auto local_state = LocalStateType::create_unique(this, state);
492
361
    RETURN_IF_ERROR(local_state->init(state, info));
493
361
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
361
    return Status::OK();
495
361
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
67.2k
                                                            LocalSinkStateInfo& info) {
491
67.2k
    auto local_state = LocalStateType::create_unique(this, state);
492
67.2k
    RETURN_IF_ERROR(local_state->init(state, info));
493
67.2k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
67.2k
    return Status::OK();
495
67.2k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_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
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
9.73k
                                                            LocalSinkStateInfo& info) {
491
9.73k
    auto local_state = LocalStateType::create_unique(this, state);
492
9.73k
    RETURN_IF_ERROR(local_state->init(state, info));
493
9.73k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
9.73k
    return Status::OK();
495
9.73k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
15
                                                            LocalSinkStateInfo& info) {
491
15
    auto local_state = LocalStateType::create_unique(this, state);
492
15
    RETURN_IF_ERROR(local_state->init(state, info));
493
15
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
15
    return Status::OK();
495
15
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
193k
                                                            LocalSinkStateInfo& info) {
491
193k
    auto local_state = LocalStateType::create_unique(this, state);
492
193k
    RETURN_IF_ERROR(local_state->init(state, info));
493
193k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
193k
    return Status::OK();
495
193k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
34
                                                            LocalSinkStateInfo& info) {
491
34
    auto local_state = LocalStateType::create_unique(this, state);
492
34
    RETURN_IF_ERROR(local_state->init(state, info));
493
34
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
34
    return Status::OK();
495
34
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
295k
                                                            LocalSinkStateInfo& info) {
491
295k
    auto local_state = LocalStateType::create_unique(this, state);
492
295k
    RETURN_IF_ERROR(local_state->init(state, info));
493
295k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
295k
    return Status::OK();
495
295k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
120k
                                                            LocalSinkStateInfo& info) {
491
120k
    auto local_state = LocalStateType::create_unique(this, state);
492
120k
    RETURN_IF_ERROR(local_state->init(state, info));
493
120k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
120k
    return Status::OK();
495
120k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
632
                                                            LocalSinkStateInfo& info) {
491
632
    auto local_state = LocalStateType::create_unique(this, state);
492
632
    RETURN_IF_ERROR(local_state->init(state, info));
493
632
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
632
    return Status::OK();
495
632
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
576k
                                                            LocalSinkStateInfo& info) {
491
576k
    auto local_state = LocalStateType::create_unique(this, state);
492
576k
    RETURN_IF_ERROR(local_state->init(state, info));
493
576k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
576k
    return Status::OK();
495
576k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
7.37k
                                                            LocalSinkStateInfo& info) {
491
7.37k
    auto local_state = LocalStateType::create_unique(this, state);
492
7.37k
    RETURN_IF_ERROR(local_state->init(state, info));
493
7.37k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
7.37k
    return Status::OK();
495
7.37k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
8.50k
                                                            LocalSinkStateInfo& info) {
491
8.50k
    auto local_state = LocalStateType::create_unique(this, state);
492
8.50k
    RETURN_IF_ERROR(local_state->init(state, info));
493
8.50k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
8.50k
    return Status::OK();
495
8.50k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
2.93k
                                                            LocalSinkStateInfo& info) {
491
2.93k
    auto local_state = LocalStateType::create_unique(this, state);
492
2.93k
    RETURN_IF_ERROR(local_state->init(state, info));
493
2.93k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
2.93k
    return Status::OK();
495
2.93k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
315
                                                            LocalSinkStateInfo& info) {
491
315
    auto local_state = LocalStateType::create_unique(this, state);
492
315
    RETURN_IF_ERROR(local_state->init(state, info));
493
315
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
315
    return Status::OK();
495
315
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
4.78k
                                                            LocalSinkStateInfo& info) {
491
4.78k
    auto local_state = LocalStateType::create_unique(this, state);
492
4.78k
    RETURN_IF_ERROR(local_state->init(state, info));
493
4.78k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
4.78k
    return Status::OK();
495
4.78k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
2.65k
                                                            LocalSinkStateInfo& info) {
491
2.65k
    auto local_state = LocalStateType::create_unique(this, state);
492
2.65k
    RETURN_IF_ERROR(local_state->init(state, info));
493
2.65k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
2.65k
    return Status::OK();
495
2.65k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
2.55k
                                                            LocalSinkStateInfo& info) {
491
2.55k
    auto local_state = LocalStateType::create_unique(this, state);
492
2.55k
    RETURN_IF_ERROR(local_state->init(state, info));
493
2.55k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
2.55k
    return Status::OK();
495
2.55k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
2.55k
                                                            LocalSinkStateInfo& info) {
491
2.55k
    auto local_state = LocalStateType::create_unique(this, state);
492
2.55k
    RETURN_IF_ERROR(local_state->init(state, info));
493
2.55k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
2.55k
    return Status::OK();
495
2.55k
}
_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
108
                                                            LocalSinkStateInfo& info) {
491
108
    auto local_state = LocalStateType::create_unique(this, state);
492
108
    RETURN_IF_ERROR(local_state->init(state, info));
493
108
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
108
    return Status::OK();
495
108
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
490
104
                                                            LocalSinkStateInfo& info) {
491
104
    auto local_state = LocalStateType::create_unique(this, state);
492
104
    RETURN_IF_ERROR(local_state->init(state, info));
493
104
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
494
104
    return Status::OK();
495
104
}
_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
1.52M
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
1.52M
    } else {
506
1.52M
        auto ss = LocalStateType::SharedStateType::create_shared();
507
1.52M
        ss->id = operator_id();
508
1.52M
        for (auto& dest : dests_id()) {
509
1.51M
            ss->related_op_ids.insert(dest);
510
1.51M
        }
511
1.52M
        return ss;
512
1.52M
    }
513
1.52M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
173k
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
173k
    } else {
506
173k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
173k
        ss->id = operator_id();
508
173k
        for (auto& dest : dests_id()) {
509
172k
            ss->related_op_ids.insert(dest);
510
172k
        }
511
173k
        return ss;
512
173k
    }
513
173k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
368k
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
368k
    } else {
506
368k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
368k
        ss->id = operator_id();
508
368k
        for (auto& dest : dests_id()) {
509
366k
            ss->related_op_ids.insert(dest);
510
366k
        }
511
368k
        return ss;
512
368k
    }
513
368k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_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
359
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
359
    } else {
506
359
        auto ss = LocalStateType::SharedStateType::create_shared();
507
359
        ss->id = operator_id();
508
360
        for (auto& dest : dests_id()) {
509
360
            ss->related_op_ids.insert(dest);
510
360
        }
511
359
        return ss;
512
359
    }
513
359
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
66.4k
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
66.4k
    } else {
506
66.4k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
66.4k
        ss->id = operator_id();
508
66.4k
        for (auto& dest : dests_id()) {
509
66.0k
            ss->related_op_ids.insert(dest);
510
66.0k
        }
511
66.4k
        return ss;
512
66.4k
    }
513
66.4k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_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
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
9.74k
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.74k
    } else {
506
9.74k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
9.74k
        ss->id = operator_id();
508
9.74k
        for (auto& dest : dests_id()) {
509
9.72k
            ss->related_op_ids.insert(dest);
510
9.72k
        }
511
9.74k
        return ss;
512
9.74k
    }
513
9.74k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
15
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
15
    } else {
506
15
        auto ss = LocalStateType::SharedStateType::create_shared();
507
15
        ss->id = operator_id();
508
15
        for (auto& dest : dests_id()) {
509
15
            ss->related_op_ids.insert(dest);
510
15
        }
511
15
        return ss;
512
15
    }
513
15
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
193k
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
193k
    } else {
506
193k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
193k
        ss->id = operator_id();
508
193k
        for (auto& dest : dests_id()) {
509
192k
            ss->related_op_ids.insert(dest);
510
192k
        }
511
193k
        return ss;
512
193k
    }
513
193k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
36
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
36
    } else {
506
36
        auto ss = LocalStateType::SharedStateType::create_shared();
507
36
        ss->id = operator_id();
508
36
        for (auto& dest : dests_id()) {
509
36
            ss->related_op_ids.insert(dest);
510
36
        }
511
36
        return ss;
512
36
    }
513
36
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
121k
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
121k
    } else {
506
121k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
121k
        ss->id = operator_id();
508
121k
        for (auto& dest : dests_id()) {
509
120k
            ss->related_op_ids.insert(dest);
510
120k
        }
511
121k
        return ss;
512
121k
    }
513
121k
}
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
631
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
631
    } else {
506
631
        auto ss = LocalStateType::SharedStateType::create_shared();
507
631
        ss->id = operator_id();
508
631
        for (auto& dest : dests_id()) {
509
631
            ss->related_op_ids.insert(dest);
510
631
        }
511
631
        return ss;
512
631
    }
513
631
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
577k
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
577k
    } else {
506
577k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
577k
        ss->id = operator_id();
508
577k
        for (auto& dest : dests_id()) {
509
572k
            ss->related_op_ids.insert(dest);
510
572k
        }
511
577k
        return ss;
512
577k
    }
513
577k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
7.40k
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
7.40k
    } else {
506
7.40k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
7.40k
        ss->id = operator_id();
508
7.40k
        for (auto& dest : dests_id()) {
509
7.37k
            ss->related_op_ids.insert(dest);
510
7.37k
        }
511
7.40k
        return ss;
512
7.40k
    }
513
7.40k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
498
416
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
416
    } else {
506
416
        auto ss = LocalStateType::SharedStateType::create_shared();
507
416
        ss->id = operator_id();
508
418
        for (auto& dest : dests_id()) {
509
418
            ss->related_op_ids.insert(dest);
510
418
        }
511
416
        return ss;
512
416
    }
513
416
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
498
2.55k
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.55k
    } else {
506
2.55k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
2.55k
        ss->id = operator_id();
508
2.55k
        for (auto& dest : dests_id()) {
509
2.54k
            ss->related_op_ids.insert(dest);
510
2.54k
        }
511
2.55k
        return ss;
512
2.55k
    }
513
2.55k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
498
2.57k
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.57k
    } else {
506
2.57k
        auto ss = LocalStateType::SharedStateType::create_shared();
507
2.57k
        ss->id = operator_id();
508
2.57k
        for (auto& dest : dests_id()) {
509
2.56k
            ss->related_op_ids.insert(dest);
510
2.56k
        }
511
2.57k
        return ss;
512
2.57k
    }
513
2.57k
}
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
104
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
104
    } else {
506
104
        auto ss = LocalStateType::SharedStateType::create_shared();
507
104
        ss->id = operator_id();
508
104
        for (auto& dest : dests_id()) {
509
104
            ss->related_op_ids.insert(dest);
510
104
        }
511
104
        return ss;
512
104
    }
513
104
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
514
515
template <typename LocalStateType>
516
2.40M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
2.40M
    auto local_state = LocalStateType::create_unique(state, this);
518
2.40M
    RETURN_IF_ERROR(local_state->init(state, info));
519
2.40M
    state->emplace_local_state(operator_id(), std::move(local_state));
520
2.40M
    return Status::OK();
521
2.40M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
133k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
133k
    auto local_state = LocalStateType::create_unique(state, this);
518
133k
    RETURN_IF_ERROR(local_state->init(state, info));
519
133k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
133k
    return Status::OK();
521
133k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
317k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
317k
    auto local_state = LocalStateType::create_unique(state, this);
518
317k
    RETURN_IF_ERROR(local_state->init(state, info));
519
317k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
317k
    return Status::OK();
521
317k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
77
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
77
    auto local_state = LocalStateType::create_unique(state, this);
518
77
    RETURN_IF_ERROR(local_state->init(state, info));
519
77
    state->emplace_local_state(operator_id(), std::move(local_state));
520
77
    return Status::OK();
521
77
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
2.67k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
2.67k
    auto local_state = LocalStateType::create_unique(state, this);
518
2.67k
    RETURN_IF_ERROR(local_state->init(state, info));
519
2.67k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
2.67k
    return Status::OK();
521
2.67k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
9.67k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
9.67k
    auto local_state = LocalStateType::create_unique(state, this);
518
9.67k
    RETURN_IF_ERROR(local_state->init(state, info));
519
9.67k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
9.67k
    return Status::OK();
521
9.67k
}
_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
28
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
28
    auto local_state = LocalStateType::create_unique(state, this);
518
28
    RETURN_IF_ERROR(local_state->init(state, info));
519
28
    state->emplace_local_state(operator_id(), std::move(local_state));
520
28
    return Status::OK();
521
28
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
179k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
179k
    auto local_state = LocalStateType::create_unique(state, this);
518
179k
    RETURN_IF_ERROR(local_state->init(state, info));
519
179k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
179k
    return Status::OK();
521
179k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
120k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
120k
    auto local_state = LocalStateType::create_unique(state, this);
518
120k
    RETURN_IF_ERROR(local_state->init(state, info));
519
120k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
120k
    return Status::OK();
521
120k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
622
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
622
    auto local_state = LocalStateType::create_unique(state, this);
518
622
    RETURN_IF_ERROR(local_state->init(state, info));
519
622
    state->emplace_local_state(operator_id(), std::move(local_state));
520
622
    return Status::OK();
521
622
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
3.33k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
3.33k
    auto local_state = LocalStateType::create_unique(state, this);
518
3.33k
    RETURN_IF_ERROR(local_state->init(state, info));
519
3.33k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
3.33k
    return Status::OK();
521
3.33k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
425k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
425k
    auto local_state = LocalStateType::create_unique(state, this);
518
425k
    RETURN_IF_ERROR(local_state->init(state, info));
519
425k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
425k
    return Status::OK();
521
425k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
1.35k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
1.35k
    auto local_state = LocalStateType::create_unique(state, this);
518
1.35k
    RETURN_IF_ERROR(local_state->init(state, info));
519
1.35k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
1.35k
    return Status::OK();
521
1.35k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
7.19k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
7.19k
    auto local_state = LocalStateType::create_unique(state, this);
518
7.19k
    RETURN_IF_ERROR(local_state->init(state, info));
519
7.19k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
7.19k
    return Status::OK();
521
7.19k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
21
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
21
    auto local_state = LocalStateType::create_unique(state, this);
518
21
    RETURN_IF_ERROR(local_state->init(state, info));
519
21
    state->emplace_local_state(operator_id(), std::move(local_state));
520
21
    return Status::OK();
521
21
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
1.55k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
1.55k
    auto local_state = LocalStateType::create_unique(state, this);
518
1.55k
    RETURN_IF_ERROR(local_state->init(state, info));
519
1.55k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
1.55k
    return Status::OK();
521
1.55k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
51.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
51.5k
    auto local_state = LocalStateType::create_unique(state, this);
518
51.5k
    RETURN_IF_ERROR(local_state->init(state, info));
519
51.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
51.5k
    return Status::OK();
521
51.5k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
7.97k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
7.97k
    auto local_state = LocalStateType::create_unique(state, this);
518
7.97k
    RETURN_IF_ERROR(local_state->init(state, info));
519
7.97k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
7.97k
    return Status::OK();
521
7.97k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
311
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
311
    auto local_state = LocalStateType::create_unique(state, this);
518
311
    RETURN_IF_ERROR(local_state->init(state, info));
519
311
    state->emplace_local_state(operator_id(), std::move(local_state));
520
311
    return Status::OK();
521
311
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
2.55k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
2.55k
    auto local_state = LocalStateType::create_unique(state, this);
518
2.55k
    RETURN_IF_ERROR(local_state->init(state, info));
519
2.55k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
2.55k
    return Status::OK();
521
2.55k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
2.56k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
2.56k
    auto local_state = LocalStateType::create_unique(state, this);
518
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
519
2.56k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
2.56k
    return Status::OK();
521
2.56k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
267
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
267
    auto local_state = LocalStateType::create_unique(state, this);
518
267
    RETURN_IF_ERROR(local_state->init(state, info));
519
267
    state->emplace_local_state(operator_id(), std::move(local_state));
520
267
    return Status::OK();
521
267
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
1.53k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
1.53k
    auto local_state = LocalStateType::create_unique(state, this);
518
1.53k
    RETURN_IF_ERROR(local_state->init(state, info));
519
1.53k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
1.53k
    return Status::OK();
521
1.53k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
5.05k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
5.05k
    auto local_state = LocalStateType::create_unique(state, this);
518
5.05k
    RETURN_IF_ERROR(local_state->init(state, info));
519
5.05k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
5.05k
    return Status::OK();
521
5.05k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
629k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
629k
    auto local_state = LocalStateType::create_unique(state, this);
518
629k
    RETURN_IF_ERROR(local_state->init(state, info));
519
629k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
629k
    return Status::OK();
521
629k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
108
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
108
    auto local_state = LocalStateType::create_unique(state, this);
518
108
    RETURN_IF_ERROR(local_state->init(state, info));
519
108
    state->emplace_local_state(operator_id(), std::move(local_state));
520
108
    return Status::OK();
521
108
}
_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
675
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
675
    auto local_state = LocalStateType::create_unique(state, this);
518
675
    RETURN_IF_ERROR(local_state->init(state, info));
519
675
    state->emplace_local_state(operator_id(), std::move(local_state));
520
675
    return Status::OK();
521
675
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
1.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
1.00k
    auto local_state = LocalStateType::create_unique(state, this);
518
1.00k
    RETURN_IF_ERROR(local_state->init(state, info));
519
1.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
1.00k
    return Status::OK();
521
1.00k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
7.85k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
7.85k
    auto local_state = LocalStateType::create_unique(state, this);
518
7.85k
    RETURN_IF_ERROR(local_state->init(state, info));
519
7.85k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
7.85k
    return Status::OK();
521
7.85k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
516
478k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
517
478k
    auto local_state = LocalStateType::create_unique(state, this);
518
478k
    RETURN_IF_ERROR(local_state->init(state, info));
519
478k
    state->emplace_local_state(operator_id(), std::move(local_state));
520
478k
    return Status::OK();
521
478k
}
522
523
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
524
                                                         RuntimeState* state)
525
1.84M
        : _parent(parent), _state(state) {}
526
527
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
528
2.40M
        : _num_rows_returned(0), _rows_returned_counter(nullptr), _parent(parent), _state(state) {}
529
530
template <typename SharedStateArg>
531
2.40M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
2.40M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
2.40M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
2.40M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
2.40M
    _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
2.40M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
2.40M
    _operator_profile->add_child(_common_profile.get(), true);
540
2.40M
    _operator_profile->add_child(_custom_profile.get(), true);
541
2.40M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
2.40M
    if constexpr (!is_fake_shared) {
543
1.15M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
544
638k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
545
638k
                                    .first.get()
546
638k
                                    ->template cast<SharedStateArg>();
547
548
638k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
549
638k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
550
638k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
551
638k
        } else if (info.shared_state) {
552
464k
            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
464k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
464k
            _dependency = _shared_state->create_source_dependency(
559
464k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
464k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
464k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
464k
        } else {
563
56.1k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
470
                DCHECK(false);
565
470
            }
566
56.1k
        }
567
1.15M
    }
568
569
2.40M
    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
2.40M
    _rows_returned_counter =
574
2.40M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
2.40M
    _blocks_returned_counter =
576
2.40M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
2.40M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
2.40M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
2.40M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
2.40M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
2.40M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
2.40M
    _memory_used_counter =
583
2.40M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
2.40M
    _common_profile->add_info_string("IsColocate",
585
2.40M
                                     std::to_string(_parent->is_colocated_operator()));
586
2.40M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
2.40M
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
2.40M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
2.40M
    return Status::OK();
590
2.40M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
134k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
134k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
134k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
134k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
134k
    _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
134k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
134k
    _operator_profile->add_child(_common_profile.get(), true);
540
134k
    _operator_profile->add_child(_custom_profile.get(), true);
541
134k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
134k
    if constexpr (!is_fake_shared) {
543
134k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
544
9.93k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
545
9.93k
                                    .first.get()
546
9.93k
                                    ->template cast<SharedStateArg>();
547
548
9.93k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
549
9.93k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
550
9.93k
                    _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
122k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
122k
            _dependency = _shared_state->create_source_dependency(
559
122k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
122k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
122k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
122k
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
1.82k
        }
567
134k
    }
568
569
134k
    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
134k
    _rows_returned_counter =
574
134k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
134k
    _blocks_returned_counter =
576
134k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
134k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
134k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
134k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
134k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
134k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
134k
    _memory_used_counter =
583
134k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
134k
    _common_profile->add_info_string("IsColocate",
585
134k
                                     std::to_string(_parent->is_colocated_operator()));
586
134k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
134k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
134k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
134k
    return Status::OK();
590
134k
}
_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
192k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
192k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
192k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
192k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
192k
    _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
192k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
192k
    _operator_profile->add_child(_common_profile.get(), true);
540
192k
    _operator_profile->add_child(_custom_profile.get(), true);
541
192k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
192k
    if constexpr (!is_fake_shared) {
543
192k
        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
192k
        } 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
188k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
188k
            _dependency = _shared_state->create_source_dependency(
559
188k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
188k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
188k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
188k
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
4.55k
        }
567
192k
    }
568
569
192k
    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
192k
    _rows_returned_counter =
574
192k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
192k
    _blocks_returned_counter =
576
192k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
192k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
192k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
192k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
192k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
192k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
192k
    _memory_used_counter =
583
192k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
192k
    _common_profile->add_info_string("IsColocate",
585
192k
                                     std::to_string(_parent->is_colocated_operator()));
586
192k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
192k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
192k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
192k
    return Status::OK();
590
192k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
28
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
28
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
28
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
28
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
28
    _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
28
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
28
    _operator_profile->add_child(_common_profile.get(), true);
540
28
    _operator_profile->add_child(_custom_profile.get(), true);
541
28
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
28
    if constexpr (!is_fake_shared) {
543
28
        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
28
        } 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
28
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
28
            _dependency = _shared_state->create_source_dependency(
559
28
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
28
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
28
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
28
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
0
        }
567
28
    }
568
569
28
    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
28
    _rows_returned_counter =
574
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
28
    _blocks_returned_counter =
576
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
28
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
28
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
28
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
28
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
28
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
28
    _memory_used_counter =
583
28
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
28
    _common_profile->add_info_string("IsColocate",
585
28
                                     std::to_string(_parent->is_colocated_operator()));
586
28
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
28
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
28
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
28
    return Status::OK();
590
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
7.02k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
7.02k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
7.02k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
7.02k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
7.02k
    _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
7.02k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
7.02k
    _operator_profile->add_child(_common_profile.get(), true);
540
7.02k
    _operator_profile->add_child(_custom_profile.get(), true);
541
7.02k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
7.02k
    if constexpr (!is_fake_shared) {
543
7.02k
        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
7.02k
        } 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
6.93k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
6.93k
            _dependency = _shared_state->create_source_dependency(
559
6.93k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
6.93k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
6.93k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
6.93k
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
93
        }
567
7.02k
    }
568
569
7.02k
    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
7.02k
    _rows_returned_counter =
574
7.02k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
7.02k
    _blocks_returned_counter =
576
7.02k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
7.02k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
7.02k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
7.02k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
7.02k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
7.02k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
7.02k
    _memory_used_counter =
583
7.02k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
7.02k
    _common_profile->add_info_string("IsColocate",
585
7.02k
                                     std::to_string(_parent->is_colocated_operator()));
586
7.02k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
7.02k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
7.02k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
7.02k
    return Status::OK();
590
7.02k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
9.67k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
9.67k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
9.67k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
9.67k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
9.67k
    _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.67k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
9.67k
    _operator_profile->add_child(_common_profile.get(), true);
540
9.67k
    _operator_profile->add_child(_custom_profile.get(), true);
541
9.67k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
9.67k
    if constexpr (!is_fake_shared) {
543
9.67k
        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.67k
        } 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.63k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
9.63k
            _dependency = _shared_state->create_source_dependency(
559
9.63k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
9.63k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
9.63k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
9.63k
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
40
        }
567
9.67k
    }
568
569
9.67k
    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.67k
    _rows_returned_counter =
574
9.67k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
9.67k
    _blocks_returned_counter =
576
9.67k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
9.67k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
9.67k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
9.67k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
9.67k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
9.67k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
9.67k
    _memory_used_counter =
583
9.67k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
9.67k
    _common_profile->add_info_string("IsColocate",
585
9.67k
                                     std::to_string(_parent->is_colocated_operator()));
586
9.67k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
9.67k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
9.67k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
9.67k
    return Status::OK();
590
9.67k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
120k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
120k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
120k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
120k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
120k
    _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
120k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
120k
    _operator_profile->add_child(_common_profile.get(), true);
540
120k
    _operator_profile->add_child(_custom_profile.get(), true);
541
120k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
120k
    if constexpr (!is_fake_shared) {
543
120k
        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
120k
        } 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
119k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
119k
            _dependency = _shared_state->create_source_dependency(
559
119k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
119k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
119k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
119k
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
1.31k
        }
567
120k
    }
568
569
120k
    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
120k
    _rows_returned_counter =
574
120k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
120k
    _blocks_returned_counter =
576
120k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
120k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
120k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
120k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
120k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
120k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
120k
    _memory_used_counter =
583
120k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
120k
    _common_profile->add_info_string("IsColocate",
585
120k
                                     std::to_string(_parent->is_colocated_operator()));
586
120k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
120k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
120k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
120k
    return Status::OK();
590
120k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
622
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
622
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
622
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
622
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
622
    _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
622
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
622
    _operator_profile->add_child(_common_profile.get(), true);
540
622
    _operator_profile->add_child(_custom_profile.get(), true);
541
622
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
622
    if constexpr (!is_fake_shared) {
543
622
        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
622
        } 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
622
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
622
            _dependency = _shared_state->create_source_dependency(
559
622
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
622
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
622
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
622
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
0
        }
567
622
    }
568
569
622
    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
622
    _rows_returned_counter =
574
622
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
622
    _blocks_returned_counter =
576
622
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
622
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
622
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
622
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
622
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
622
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
622
    _memory_used_counter =
583
622
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
622
    _common_profile->add_info_string("IsColocate",
585
622
                                     std::to_string(_parent->is_colocated_operator()));
586
622
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
622
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
622
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
622
    return Status::OK();
590
622
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
1.24M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
1.24M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
1.24M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
1.24M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
1.24M
    _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.24M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
1.24M
    _operator_profile->add_child(_common_profile.get(), true);
540
1.24M
    _operator_profile->add_child(_custom_profile.get(), true);
541
1.24M
    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.24M
    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.24M
    _rows_returned_counter =
574
1.24M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
1.24M
    _blocks_returned_counter =
576
1.24M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
1.24M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
1.24M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
1.24M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
1.24M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
1.24M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
1.24M
    _memory_used_counter =
583
1.24M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
1.24M
    _common_profile->add_info_string("IsColocate",
585
1.24M
                                     std::to_string(_parent->is_colocated_operator()));
586
1.24M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
1.24M
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
1.24M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
1.24M
    return Status::OK();
590
1.24M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
51.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
51.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
51.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
51.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
51.5k
    _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
51.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
51.5k
    _operator_profile->add_child(_common_profile.get(), true);
540
51.5k
    _operator_profile->add_child(_custom_profile.get(), true);
541
51.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
51.5k
    if constexpr (!is_fake_shared) {
543
51.5k
        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
51.5k
        } 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
3.82k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
3.82k
            _dependency = _shared_state->create_source_dependency(
559
3.82k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
3.82k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
3.82k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
47.7k
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
47.7k
        }
567
51.5k
    }
568
569
51.5k
    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
51.5k
    _rows_returned_counter =
574
51.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
51.5k
    _blocks_returned_counter =
576
51.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
51.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
51.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
51.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
51.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
51.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
51.5k
    _memory_used_counter =
583
51.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
51.5k
    _common_profile->add_info_string("IsColocate",
585
51.5k
                                     std::to_string(_parent->is_colocated_operator()));
586
51.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
51.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
51.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
51.5k
    return Status::OK();
590
51.5k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
111
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
111
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
111
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
111
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
111
    _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
111
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
111
    _operator_profile->add_child(_common_profile.get(), true);
540
111
    _operator_profile->add_child(_custom_profile.get(), true);
541
111
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
111
    if constexpr (!is_fake_shared) {
543
111
        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
111
        } 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
111
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
111
            _dependency = _shared_state->create_source_dependency(
559
111
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
111
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
111
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
111
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
0
        }
567
111
    }
568
569
111
    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
111
    _rows_returned_counter =
574
111
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
111
    _blocks_returned_counter =
576
111
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
111
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
111
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
111
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
111
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
111
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
111
    _memory_used_counter =
583
111
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
111
    _common_profile->add_info_string("IsColocate",
585
111
                                     std::to_string(_parent->is_colocated_operator()));
586
111
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
111
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
111
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
111
    return Status::OK();
590
111
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
7.96k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
7.96k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
7.96k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
7.96k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
7.96k
    _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
7.96k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
7.96k
    _operator_profile->add_child(_common_profile.get(), true);
540
7.96k
    _operator_profile->add_child(_custom_profile.get(), true);
541
7.96k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
7.96k
    if constexpr (!is_fake_shared) {
543
7.96k
        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
7.96k
        } 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
7.91k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
7.91k
            _dependency = _shared_state->create_source_dependency(
559
7.91k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
7.91k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
7.91k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
7.91k
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
52
        }
567
7.96k
    }
568
569
7.96k
    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
7.96k
    _rows_returned_counter =
574
7.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
7.96k
    _blocks_returned_counter =
576
7.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
7.96k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
7.96k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
7.96k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
7.96k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
7.96k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
7.96k
    _memory_used_counter =
583
7.96k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
7.96k
    _common_profile->add_info_string("IsColocate",
585
7.96k
                                     std::to_string(_parent->is_colocated_operator()));
586
7.96k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
7.96k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
7.96k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
7.96k
    return Status::OK();
590
7.96k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
413
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
413
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
413
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
413
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
413
    _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
413
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
413
    _operator_profile->add_child(_common_profile.get(), true);
540
413
    _operator_profile->add_child(_custom_profile.get(), true);
541
413
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
413
    if constexpr (!is_fake_shared) {
543
413
        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
413
        } 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
408
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
408
            _dependency = _shared_state->create_source_dependency(
559
408
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
408
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
408
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
408
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
5
        }
567
413
    }
568
569
413
    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
413
    _rows_returned_counter =
574
413
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
413
    _blocks_returned_counter =
576
413
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
413
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
413
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
413
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
413
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
413
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
413
    _memory_used_counter =
583
413
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
413
    _common_profile->add_info_string("IsColocate",
585
413
                                     std::to_string(_parent->is_colocated_operator()));
586
413
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
413
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
413
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
413
    return Status::OK();
590
413
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
5.15k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
5.15k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
5.15k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
5.15k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
5.15k
    _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.15k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
5.15k
    _operator_profile->add_child(_common_profile.get(), true);
540
5.15k
    _operator_profile->add_child(_custom_profile.get(), true);
541
5.15k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
5.15k
    if constexpr (!is_fake_shared) {
543
5.15k
        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.15k
        } 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.11k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
557
558
5.11k
            _dependency = _shared_state->create_source_dependency(
559
5.11k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
560
5.11k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
561
5.11k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
562
5.11k
        } else {
563
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
                DCHECK(false);
565
            }
566
43
        }
567
5.15k
    }
568
569
5.15k
    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.15k
    _rows_returned_counter =
574
5.15k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
5.15k
    _blocks_returned_counter =
576
5.15k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
5.15k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
5.15k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
5.15k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
5.15k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
5.15k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
5.15k
    _memory_used_counter =
583
5.15k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
5.15k
    _common_profile->add_info_string("IsColocate",
585
5.15k
                                     std::to_string(_parent->is_colocated_operator()));
586
5.15k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
5.15k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
5.15k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
5.15k
    return Status::OK();
590
5.15k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
531
628k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
532
628k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
533
628k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
534
628k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
535
628k
    _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
628k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
539
628k
    _operator_profile->add_child(_common_profile.get(), true);
540
628k
    _operator_profile->add_child(_custom_profile.get(), true);
541
628k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
542
628k
    if constexpr (!is_fake_shared) {
543
628k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
544
628k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
545
628k
                                    .first.get()
546
628k
                                    ->template cast<SharedStateArg>();
547
548
628k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
549
628k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
550
628k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
551
628k
        } 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
470
        } else {
563
470
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
564
470
                DCHECK(false);
565
470
            }
566
470
        }
567
628k
    }
568
569
628k
    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
628k
    _rows_returned_counter =
574
628k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
575
628k
    _blocks_returned_counter =
576
628k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
577
628k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
578
628k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
579
628k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
580
628k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
581
628k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
582
628k
    _memory_used_counter =
583
628k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
584
628k
    _common_profile->add_info_string("IsColocate",
585
628k
                                     std::to_string(_parent->is_colocated_operator()));
586
628k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
587
628k
    _common_profile->add_info_string("FollowedByShuffledOperator",
588
628k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
589
628k
    return Status::OK();
590
628k
}
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
2.42M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
2.42M
    _conjuncts.resize(_parent->_conjuncts.size());
595
2.42M
    _projections.resize(_parent->_projections.size());
596
2.75M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
332k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
332k
    }
599
5.00M
    for (size_t i = 0; i < _projections.size(); i++) {
600
2.58M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
2.58M
    }
602
2.42M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
2.42M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
604
8.62k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
605
53.4k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
606
44.7k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
607
44.7k
                    state, _intermediate_projections[i][j]));
608
44.7k
        }
609
8.62k
    }
610
2.42M
    return Status::OK();
611
2.42M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
135k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
135k
    _conjuncts.resize(_parent->_conjuncts.size());
595
135k
    _projections.resize(_parent->_projections.size());
596
137k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
1.62k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
1.62k
    }
599
713k
    for (size_t i = 0; i < _projections.size(); i++) {
600
577k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
577k
    }
602
135k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
136k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
604
522
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
605
4.52k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
606
4.00k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
607
4.00k
                    state, _intermediate_projections[i][j]));
608
4.00k
        }
609
522
    }
610
135k
    return Status::OK();
611
135k
}
_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
193k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
193k
    _conjuncts.resize(_parent->_conjuncts.size());
595
193k
    _projections.resize(_parent->_projections.size());
596
193k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
0
    }
599
212k
    for (size_t i = 0; i < _projections.size(); i++) {
600
18.9k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
18.9k
    }
602
193k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
193k
    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
193k
    return Status::OK();
611
193k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
28
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
28
    _conjuncts.resize(_parent->_conjuncts.size());
595
28
    _projections.resize(_parent->_projections.size());
596
28
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
0
    }
599
28
    for (size_t i = 0; i < _projections.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
0
    }
602
28
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
28
    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
28
    return Status::OK();
611
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
7.41k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
7.41k
    _conjuncts.resize(_parent->_conjuncts.size());
595
7.41k
    _projections.resize(_parent->_projections.size());
596
7.54k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
129
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
129
    }
599
36.8k
    for (size_t i = 0; i < _projections.size(); i++) {
600
29.4k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
29.4k
    }
602
7.41k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
7.43k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
604
26
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
605
210
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
606
184
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
607
184
                    state, _intermediate_projections[i][j]));
608
184
        }
609
26
    }
610
7.41k
    return Status::OK();
611
7.41k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
9.74k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
9.74k
    _conjuncts.resize(_parent->_conjuncts.size());
595
9.74k
    _projections.resize(_parent->_projections.size());
596
10.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
913
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
913
    }
599
26.3k
    for (size_t i = 0; i < _projections.size(); i++) {
600
16.5k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
16.5k
    }
602
9.74k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
9.91k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
604
167
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
605
1.25k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
606
1.09k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
607
1.09k
                    state, _intermediate_projections[i][j]));
608
1.09k
        }
609
167
    }
610
9.74k
    return Status::OK();
611
9.74k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
121k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
121k
    _conjuncts.resize(_parent->_conjuncts.size());
595
121k
    _projections.resize(_parent->_projections.size());
596
122k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
1.82k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
1.82k
    }
599
438k
    for (size_t i = 0; i < _projections.size(); i++) {
600
317k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
317k
    }
602
121k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
121k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
604
257
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
605
2.29k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
606
2.03k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
607
2.03k
                    state, _intermediate_projections[i][j]));
608
2.03k
        }
609
257
    }
610
121k
    return Status::OK();
611
121k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
626
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
626
    _conjuncts.resize(_parent->_conjuncts.size());
595
626
    _projections.resize(_parent->_projections.size());
596
626
    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.46k
    for (size_t i = 0; i < _projections.size(); i++) {
600
836
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
836
    }
602
626
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
626
    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
626
    return Status::OK();
611
626
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
1.25M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
1.25M
    _conjuncts.resize(_parent->_conjuncts.size());
595
1.25M
    _projections.resize(_parent->_projections.size());
596
1.57M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
325k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
325k
    }
599
2.77M
    for (size_t i = 0; i < _projections.size(); i++) {
600
1.52M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
1.52M
    }
602
1.25M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
1.25M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
604
7.65k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
605
45.1k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
606
37.4k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
607
37.4k
                    state, _intermediate_projections[i][j]));
608
37.4k
        }
609
7.65k
    }
610
1.25M
    return Status::OK();
611
1.25M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
51.7k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
51.7k
    _conjuncts.resize(_parent->_conjuncts.size());
595
51.7k
    _projections.resize(_parent->_projections.size());
596
51.7k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
0
    }
599
146k
    for (size_t i = 0; i < _projections.size(); i++) {
600
95.0k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
95.0k
    }
602
51.7k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
51.7k
    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
51.7k
    return Status::OK();
611
51.7k
}
_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
7.98k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
7.98k
    _conjuncts.resize(_parent->_conjuncts.size());
595
7.98k
    _projections.resize(_parent->_projections.size());
596
9.76k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
1.78k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
1.78k
    }
599
7.98k
    for (size_t i = 0; i < _projections.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
0
    }
602
7.98k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
7.98k
    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
7.98k
    return Status::OK();
611
7.98k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
420
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
420
    _conjuncts.resize(_parent->_conjuncts.size());
595
420
    _projections.resize(_parent->_projections.size());
596
420
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
0
    }
599
420
    for (size_t i = 0; i < _projections.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
0
    }
602
420
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
420
    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
420
    return Status::OK();
611
420
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
5.16k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
5.16k
    _conjuncts.resize(_parent->_conjuncts.size());
595
5.16k
    _projections.resize(_parent->_projections.size());
596
5.16k
    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.16k
    for (size_t i = 0; i < _projections.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
0
    }
602
5.16k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
5.16k
    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.16k
    return Status::OK();
611
5.16k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
593
634k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
594
634k
    _conjuncts.resize(_parent->_conjuncts.size());
595
634k
    _projections.resize(_parent->_projections.size());
596
634k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
598
0
    }
599
634k
    for (size_t i = 0; i < _projections.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
601
0
    }
602
634k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
603
634k
    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
634k
    return Status::OK();
611
634k
}
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.42k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
8.42k
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
8.42k
    _terminated = true;
619
8.42k
    return Status::OK();
620
8.42k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
391
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
391
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
391
    _terminated = true;
619
391
    return Status::OK();
620
391
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
145
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
145
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
145
    _terminated = true;
619
145
    return Status::OK();
620
145
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
93
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
93
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
93
    _terminated = true;
619
93
    return Status::OK();
620
93
}
_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.21k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
1.21k
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
1.21k
    _terminated = true;
619
1.21k
    return Status::OK();
620
1.21k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
5.71k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
5.71k
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
5.71k
    _terminated = true;
619
5.71k
    return Status::OK();
620
5.71k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
3
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
3
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
3
    _terminated = true;
619
3
    return Status::OK();
620
3
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
6
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
6
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
6
    _terminated = true;
619
6
    return Status::OK();
620
6
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
12
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
12
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
12
    _terminated = true;
619
12
    return Status::OK();
620
12
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
830
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
830
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
830
    _terminated = true;
619
830
    return Status::OK();
620
830
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
614
17
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
615
17
    if (_terminated) {
616
0
        return Status::OK();
617
0
    }
618
17
    _terminated = true;
619
17
    return Status::OK();
620
17
}
621
622
template <typename SharedStateArg>
623
2.64M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
2.64M
    if (_closed) {
625
223k
        return Status::OK();
626
223k
    }
627
2.42M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
1.16M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
1.16M
    }
630
2.42M
    _closed = true;
631
2.42M
    return Status::OK();
632
2.64M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
135k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
135k
    if (_closed) {
625
0
        return Status::OK();
626
0
    }
627
135k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
135k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
135k
    }
630
135k
    _closed = true;
631
135k
    return Status::OK();
632
135k
}
_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
385k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
385k
    if (_closed) {
625
193k
        return Status::OK();
626
193k
    }
627
192k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
192k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
192k
    }
630
192k
    _closed = true;
631
192k
    return Status::OK();
632
385k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
28
    if (_closed) {
625
0
        return Status::OK();
626
0
    }
627
28
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
28
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
28
    }
630
28
    _closed = true;
631
28
    return Status::OK();
632
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
7.40k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
7.40k
    if (_closed) {
625
0
        return Status::OK();
626
0
    }
627
7.40k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
7.40k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
7.40k
    }
630
7.40k
    _closed = true;
631
7.40k
    return Status::OK();
632
7.40k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
19.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
19.5k
    if (_closed) {
625
9.87k
        return Status::OK();
626
9.87k
    }
627
9.71k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
9.71k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
9.71k
    }
630
9.71k
    _closed = true;
631
9.71k
    return Status::OK();
632
19.5k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
120k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
120k
    if (_closed) {
625
0
        return Status::OK();
626
0
    }
627
120k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
120k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
120k
    }
630
120k
    _closed = true;
631
120k
    return Status::OK();
632
120k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
621
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
621
    if (_closed) {
625
0
        return Status::OK();
626
0
    }
627
621
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
621
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
621
    }
630
621
    _closed = true;
631
621
    return Status::OK();
632
621
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
1.26M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
1.26M
    if (_closed) {
625
14.2k
        return Status::OK();
626
14.2k
    }
627
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
    }
630
1.25M
    _closed = true;
631
1.25M
    return Status::OK();
632
1.26M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
51.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
51.8k
    if (_closed) {
625
0
        return Status::OK();
626
0
    }
627
51.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
51.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
51.8k
    }
630
51.8k
    _closed = true;
631
51.8k
    return Status::OK();
632
51.8k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
216
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
216
    if (_closed) {
625
108
        return Status::OK();
626
108
    }
627
108
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
108
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
108
    }
630
108
    _closed = true;
631
108
    return Status::OK();
632
216
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
7.95k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
7.95k
    if (_closed) {
625
0
        return Status::OK();
626
0
    }
627
7.95k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
7.95k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
7.95k
    }
630
7.95k
    _closed = true;
631
7.95k
    return Status::OK();
632
7.95k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
633
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
633
    if (_closed) {
625
318
        return Status::OK();
626
318
    }
627
315
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
315
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
315
    }
630
315
    _closed = true;
631
315
    return Status::OK();
632
633
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
10.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
10.4k
    if (_closed) {
625
5.33k
        return Status::OK();
626
5.33k
    }
627
5.14k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
5.14k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
5.14k
    }
630
5.14k
    _closed = true;
631
5.14k
    return Status::OK();
632
10.4k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
636k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
636k
    if (_closed) {
625
0
        return Status::OK();
626
0
    }
627
636k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
636k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
636k
    }
630
636k
    _closed = true;
631
636k
    return Status::OK();
632
636k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
623
305
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
624
305
    if (_closed) {
625
157
        return Status::OK();
626
157
    }
627
148
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
628
148
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
629
148
    }
630
148
    _closed = true;
631
148
    return Status::OK();
632
305
}
633
634
template <typename SharedState>
635
1.84M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
1.84M
    _operator_profile =
638
1.84M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
1.84M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
1.84M
    _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
1.84M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
1.84M
    _operator_profile->add_child(_common_profile, true);
647
1.84M
    _operator_profile->add_child(_custom_profile, true);
648
649
1.84M
    _operator_profile->set_metadata(_parent->node_id());
650
1.84M
    _wait_for_finish_dependency_timer =
651
1.84M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
1.84M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
1.84M
    if constexpr (!is_fake_shared) {
654
1.27M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
1.27M
            info.shared_state_map.end()) {
656
305k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
657
295k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
658
295k
            }
659
305k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
660
305k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
661
305k
                                                  ? 0
662
305k
                                                  : info.task_idx]
663
305k
                                  .get();
664
305k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
665
965k
        } else {
666
965k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
363
                DCHECK(false);
668
363
            }
669
965k
            _shared_state = info.shared_state->template cast<SharedState>();
670
965k
            _dependency = _shared_state->create_sink_dependency(
671
965k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
965k
        }
673
1.27M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
1.27M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
1.27M
    }
676
677
1.84M
    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
1.84M
    _rows_input_counter =
682
1.84M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
1.84M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
1.84M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
1.84M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
1.84M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
1.84M
    _memory_used_counter =
688
1.84M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
1.84M
    _common_profile->add_info_string("IsColocate",
690
1.84M
                                     std::to_string(_parent->is_colocated_operator()));
691
1.84M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
1.84M
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
1.84M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
1.84M
    return Status::OK();
695
1.84M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
183k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
183k
    _operator_profile =
638
183k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
183k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
183k
    _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
183k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
183k
    _operator_profile->add_child(_common_profile, true);
647
183k
    _operator_profile->add_child(_custom_profile, true);
648
649
183k
    _operator_profile->set_metadata(_parent->node_id());
650
183k
    _wait_for_finish_dependency_timer =
651
183k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
183k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
183k
    if constexpr (!is_fake_shared) {
654
183k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
183k
            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
9.98k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
660
9.98k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
661
9.98k
                                                  ? 0
662
9.98k
                                                  : info.task_idx]
663
9.98k
                                  .get();
664
9.98k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
665
173k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
173k
            _shared_state = info.shared_state->template cast<SharedState>();
670
173k
            _dependency = _shared_state->create_sink_dependency(
671
173k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
173k
        }
673
183k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
183k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
183k
    }
676
677
183k
    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
183k
    _rows_input_counter =
682
183k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
183k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
183k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
183k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
183k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
183k
    _memory_used_counter =
688
183k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
183k
    _common_profile->add_info_string("IsColocate",
690
183k
                                     std::to_string(_parent->is_colocated_operator()));
691
183k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
183k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
183k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
183k
    return Status::OK();
695
183k
}
_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
193k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
193k
    _operator_profile =
638
193k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
193k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
193k
    _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
193k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
193k
    _operator_profile->add_child(_common_profile, true);
647
193k
    _operator_profile->add_child(_custom_profile, true);
648
649
193k
    _operator_profile->set_metadata(_parent->node_id());
650
193k
    _wait_for_finish_dependency_timer =
651
193k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
193k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
193k
    if constexpr (!is_fake_shared) {
654
193k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
193k
            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
193k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
193k
            _shared_state = info.shared_state->template cast<SharedState>();
670
193k
            _dependency = _shared_state->create_sink_dependency(
671
193k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
193k
        }
673
193k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
193k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
193k
    }
676
677
193k
    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
193k
    _rows_input_counter =
682
193k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
193k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
193k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
193k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
193k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
193k
    _memory_used_counter =
688
193k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
193k
    _common_profile->add_info_string("IsColocate",
690
193k
                                     std::to_string(_parent->is_colocated_operator()));
691
193k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
193k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
193k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
193k
    return Status::OK();
695
193k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
34
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
34
    _operator_profile =
638
34
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
34
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
34
    _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
34
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
34
    _operator_profile->add_child(_common_profile, true);
647
34
    _operator_profile->add_child(_custom_profile, true);
648
649
34
    _operator_profile->set_metadata(_parent->node_id());
650
34
    _wait_for_finish_dependency_timer =
651
34
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
34
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
34
    if constexpr (!is_fake_shared) {
654
34
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
34
            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
34
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
34
            _shared_state = info.shared_state->template cast<SharedState>();
670
34
            _dependency = _shared_state->create_sink_dependency(
671
34
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
34
        }
673
34
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
34
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
34
    }
676
677
34
    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
34
    _rows_input_counter =
682
34
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
34
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
34
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
34
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
34
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
34
    _memory_used_counter =
688
34
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
34
    _common_profile->add_info_string("IsColocate",
690
34
                                     std::to_string(_parent->is_colocated_operator()));
691
34
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
34
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
34
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
34
    return Status::OK();
695
34
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
7.38k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
7.38k
    _operator_profile =
638
7.38k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
7.38k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
7.38k
    _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
7.38k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
7.38k
    _operator_profile->add_child(_common_profile, true);
647
7.38k
    _operator_profile->add_child(_custom_profile, true);
648
649
7.38k
    _operator_profile->set_metadata(_parent->node_id());
650
7.38k
    _wait_for_finish_dependency_timer =
651
7.38k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
7.38k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
7.38k
    if constexpr (!is_fake_shared) {
654
7.38k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
7.38k
            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
7.38k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
7.38k
            _shared_state = info.shared_state->template cast<SharedState>();
670
7.38k
            _dependency = _shared_state->create_sink_dependency(
671
7.38k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
7.38k
        }
673
7.38k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
7.38k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
7.38k
    }
676
677
7.38k
    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
7.38k
    _rows_input_counter =
682
7.38k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
7.38k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
7.38k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
7.38k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
7.38k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
7.38k
    _memory_used_counter =
688
7.38k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
7.38k
    _common_profile->add_info_string("IsColocate",
690
7.38k
                                     std::to_string(_parent->is_colocated_operator()));
691
7.38k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
7.38k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
7.38k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
7.38k
    return Status::OK();
695
7.38k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
9.73k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
9.73k
    _operator_profile =
638
9.73k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
9.73k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
9.73k
    _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.73k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
9.73k
    _operator_profile->add_child(_common_profile, true);
647
9.73k
    _operator_profile->add_child(_custom_profile, true);
648
649
9.73k
    _operator_profile->set_metadata(_parent->node_id());
650
9.73k
    _wait_for_finish_dependency_timer =
651
9.73k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
9.73k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
9.73k
    if constexpr (!is_fake_shared) {
654
9.73k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
9.73k
            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.73k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
9.73k
            _shared_state = info.shared_state->template cast<SharedState>();
670
9.73k
            _dependency = _shared_state->create_sink_dependency(
671
9.73k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
9.73k
        }
673
9.73k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
9.73k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
9.73k
    }
676
677
9.73k
    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.73k
    _rows_input_counter =
682
9.73k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
9.73k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
9.73k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
9.73k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
9.73k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
9.73k
    _memory_used_counter =
688
9.73k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
9.73k
    _common_profile->add_info_string("IsColocate",
690
9.73k
                                     std::to_string(_parent->is_colocated_operator()));
691
9.73k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
9.73k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
9.73k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
9.73k
    return Status::OK();
695
9.73k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
120k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
120k
    _operator_profile =
638
120k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
120k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
120k
    _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
120k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
120k
    _operator_profile->add_child(_common_profile, true);
647
120k
    _operator_profile->add_child(_custom_profile, true);
648
649
120k
    _operator_profile->set_metadata(_parent->node_id());
650
120k
    _wait_for_finish_dependency_timer =
651
120k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
120k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
120k
    if constexpr (!is_fake_shared) {
654
120k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
120k
            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
120k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
120k
            _shared_state = info.shared_state->template cast<SharedState>();
670
120k
            _dependency = _shared_state->create_sink_dependency(
671
120k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
120k
        }
673
120k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
120k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
120k
    }
676
677
120k
    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
120k
    _rows_input_counter =
682
120k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
120k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
120k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
120k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
120k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
120k
    _memory_used_counter =
688
120k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
120k
    _common_profile->add_info_string("IsColocate",
690
120k
                                     std::to_string(_parent->is_colocated_operator()));
691
120k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
120k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
120k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
120k
    return Status::OK();
695
120k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
632
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
632
    _operator_profile =
638
632
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
632
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
632
    _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
632
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
632
    _operator_profile->add_child(_common_profile, true);
647
632
    _operator_profile->add_child(_custom_profile, true);
648
649
632
    _operator_profile->set_metadata(_parent->node_id());
650
632
    _wait_for_finish_dependency_timer =
651
632
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
632
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
632
    if constexpr (!is_fake_shared) {
654
632
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
632
            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
632
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
632
            _shared_state = info.shared_state->template cast<SharedState>();
670
632
            _dependency = _shared_state->create_sink_dependency(
671
632
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
632
        }
673
632
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
632
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
632
    }
676
677
632
    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
632
    _rows_input_counter =
682
632
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
632
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
632
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
632
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
632
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
632
    _memory_used_counter =
688
632
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
632
    _common_profile->add_info_string("IsColocate",
690
632
                                     std::to_string(_parent->is_colocated_operator()));
691
632
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
632
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
632
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
632
    return Status::OK();
695
632
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
577k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
577k
    _operator_profile =
638
577k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
577k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
577k
    _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
577k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
577k
    _operator_profile->add_child(_common_profile, true);
647
577k
    _operator_profile->add_child(_custom_profile, true);
648
649
577k
    _operator_profile->set_metadata(_parent->node_id());
650
577k
    _wait_for_finish_dependency_timer =
651
577k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
577k
    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
577k
    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
577k
    _rows_input_counter =
682
577k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
577k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
577k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
577k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
577k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
577k
    _memory_used_counter =
688
577k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
577k
    _common_profile->add_info_string("IsColocate",
690
577k
                                     std::to_string(_parent->is_colocated_operator()));
691
577k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
577k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
577k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
577k
    return Status::OK();
695
577k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
8.52k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
8.52k
    _operator_profile =
638
8.52k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
8.52k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
8.52k
    _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
8.52k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
8.52k
    _operator_profile->add_child(_common_profile, true);
647
8.52k
    _operator_profile->add_child(_custom_profile, true);
648
649
8.52k
    _operator_profile->set_metadata(_parent->node_id());
650
8.52k
    _wait_for_finish_dependency_timer =
651
8.52k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
8.52k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
8.52k
    if constexpr (!is_fake_shared) {
654
8.52k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
8.52k
            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
8.52k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
8.52k
            _shared_state = info.shared_state->template cast<SharedState>();
670
8.52k
            _dependency = _shared_state->create_sink_dependency(
671
8.52k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
8.52k
        }
673
8.52k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
8.52k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
8.52k
    }
676
677
8.52k
    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
8.52k
    _rows_input_counter =
682
8.52k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
8.52k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
8.52k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
8.52k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
8.52k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
8.52k
    _memory_used_counter =
688
8.52k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
8.52k
    _common_profile->add_info_string("IsColocate",
690
8.52k
                                     std::to_string(_parent->is_colocated_operator()));
691
8.52k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
8.52k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
8.52k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
8.52k
    return Status::OK();
695
8.52k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
418
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
418
    _operator_profile =
638
418
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
418
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
418
    _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
418
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
418
    _operator_profile->add_child(_common_profile, true);
647
418
    _operator_profile->add_child(_custom_profile, true);
648
649
418
    _operator_profile->set_metadata(_parent->node_id());
650
418
    _wait_for_finish_dependency_timer =
651
418
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
418
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
418
    if constexpr (!is_fake_shared) {
654
418
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
418
            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
418
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
418
            _shared_state = info.shared_state->template cast<SharedState>();
670
418
            _dependency = _shared_state->create_sink_dependency(
671
418
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
418
        }
673
418
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
418
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
418
    }
676
677
418
    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
418
    _rows_input_counter =
682
418
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
418
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
418
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
418
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
418
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
418
    _memory_used_counter =
688
418
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
418
    _common_profile->add_info_string("IsColocate",
690
418
                                     std::to_string(_parent->is_colocated_operator()));
691
418
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
418
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
418
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
418
    return Status::OK();
695
418
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
2.94k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
2.94k
    _operator_profile =
638
2.94k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
2.94k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
2.94k
    _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.94k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
2.94k
    _operator_profile->add_child(_common_profile, true);
647
2.94k
    _operator_profile->add_child(_custom_profile, true);
648
649
2.94k
    _operator_profile->set_metadata(_parent->node_id());
650
2.94k
    _wait_for_finish_dependency_timer =
651
2.94k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
2.94k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
2.94k
    if constexpr (!is_fake_shared) {
654
2.94k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
2.94k
            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.94k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
2.94k
            _shared_state = info.shared_state->template cast<SharedState>();
670
2.94k
            _dependency = _shared_state->create_sink_dependency(
671
2.94k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
2.94k
        }
673
2.94k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
2.94k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
2.94k
    }
676
677
2.94k
    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.94k
    _rows_input_counter =
682
2.94k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
2.94k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
2.94k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
2.94k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
2.94k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
2.94k
    _memory_used_counter =
688
2.94k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
2.94k
    _common_profile->add_info_string("IsColocate",
690
2.94k
                                     std::to_string(_parent->is_colocated_operator()));
691
2.94k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
2.94k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
2.94k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
2.94k
    return Status::OK();
695
2.94k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
12.6k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
12.6k
    _operator_profile =
638
12.6k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
12.6k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
12.6k
    _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
12.6k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
12.6k
    _operator_profile->add_child(_common_profile, true);
647
12.6k
    _operator_profile->add_child(_custom_profile, true);
648
649
12.6k
    _operator_profile->set_metadata(_parent->node_id());
650
12.6k
    _wait_for_finish_dependency_timer =
651
12.6k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
12.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
12.6k
    if constexpr (!is_fake_shared) {
654
12.6k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
12.6k
            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
12.6k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
12.6k
            _shared_state = info.shared_state->template cast<SharedState>();
670
12.6k
            _dependency = _shared_state->create_sink_dependency(
671
12.6k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
12.6k
        }
673
12.6k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
12.6k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
12.6k
    }
676
677
12.6k
    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
12.6k
    _rows_input_counter =
682
12.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
12.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
12.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
12.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
12.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
12.6k
    _memory_used_counter =
688
12.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
12.6k
    _common_profile->add_info_string("IsColocate",
690
12.6k
                                     std::to_string(_parent->is_colocated_operator()));
691
12.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
12.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
12.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
12.6k
    return Status::OK();
695
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
295k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
295k
    _operator_profile =
638
295k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
295k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
295k
    _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
295k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
295k
    _operator_profile->add_child(_common_profile, true);
647
295k
    _operator_profile->add_child(_custom_profile, true);
648
649
295k
    _operator_profile->set_metadata(_parent->node_id());
650
295k
    _wait_for_finish_dependency_timer =
651
295k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
295k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
295k
    if constexpr (!is_fake_shared) {
654
295k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
295k
            info.shared_state_map.end()) {
656
295k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
657
295k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
658
295k
            }
659
295k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
660
295k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
661
295k
                                                  ? 0
662
295k
                                                  : info.task_idx]
663
295k
                                  .get();
664
295k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
665
295k
        } else {
666
363
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
363
                DCHECK(false);
668
363
            }
669
363
            _shared_state = info.shared_state->template cast<SharedState>();
670
363
            _dependency = _shared_state->create_sink_dependency(
671
363
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
363
        }
673
295k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
295k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
295k
    }
676
677
295k
    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
295k
    _rows_input_counter =
682
295k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
295k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
295k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
295k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
295k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
295k
    _memory_used_counter =
688
295k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
295k
    _common_profile->add_info_string("IsColocate",
690
295k
                                     std::to_string(_parent->is_colocated_operator()));
691
295k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
295k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
295k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
295k
    return Status::OK();
695
295k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
635
435k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
636
    // create profile
637
435k
    _operator_profile =
638
435k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
639
435k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
640
435k
    _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
435k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
646
435k
    _operator_profile->add_child(_common_profile, true);
647
435k
    _operator_profile->add_child(_custom_profile, true);
648
649
435k
    _operator_profile->set_metadata(_parent->node_id());
650
435k
    _wait_for_finish_dependency_timer =
651
435k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
652
435k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
653
435k
    if constexpr (!is_fake_shared) {
654
435k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
655
435k
            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
814
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
660
814
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
661
814
                                                  ? 0
662
814
                                                  : info.task_idx]
663
814
                                  .get();
664
814
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
665
435k
        } else {
666
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
667
                DCHECK(false);
668
            }
669
435k
            _shared_state = info.shared_state->template cast<SharedState>();
670
435k
            _dependency = _shared_state->create_sink_dependency(
671
435k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
672
435k
        }
673
435k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
674
435k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
675
435k
    }
676
677
435k
    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
435k
    _rows_input_counter =
682
435k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
683
435k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
684
435k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
685
435k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
686
435k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
687
435k
    _memory_used_counter =
688
435k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
689
435k
    _common_profile->add_info_string("IsColocate",
690
435k
                                     std::to_string(_parent->is_colocated_operator()));
691
435k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
692
435k
    _common_profile->add_info_string("FollowedByShuffledOperator",
693
435k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
694
435k
    return Status::OK();
695
435k
}
_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
1.85M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
1.85M
    if (_closed) {
700
2
        return Status::OK();
701
2
    }
702
1.85M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
1.27M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
1.27M
    }
705
1.85M
    _closed = true;
706
1.85M
    return Status::OK();
707
1.85M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
183k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
183k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
183k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
183k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
183k
    }
705
183k
    _closed = true;
706
183k
    return Status::OK();
707
183k
}
_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
193k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
193k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
193k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
193k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
193k
    }
705
193k
    _closed = true;
706
193k
    return Status::OK();
707
193k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
26
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
26
    if (_closed) {
700
2
        return Status::OK();
701
2
    }
702
24
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
24
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
24
    }
705
24
    _closed = true;
706
24
    return Status::OK();
707
26
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
7.37k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
7.37k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
7.37k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
7.37k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
7.37k
    }
705
7.37k
    _closed = true;
706
7.37k
    return Status::OK();
707
7.37k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
9.66k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
9.66k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
9.66k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
9.66k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
9.66k
    }
705
9.66k
    _closed = true;
706
9.66k
    return Status::OK();
707
9.66k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
120k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
120k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
120k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
120k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
120k
    }
705
120k
    _closed = true;
706
120k
    return Status::OK();
707
120k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
621
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
621
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
621
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
621
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
621
    }
705
621
    _closed = true;
706
621
    return Status::OK();
707
621
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
579k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
579k
    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
579k
    _closed = true;
706
579k
    return Status::OK();
707
579k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
8.56k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
8.56k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
8.56k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
8.56k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
8.56k
    }
705
8.56k
    _closed = true;
706
8.56k
    return Status::OK();
707
8.56k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
314
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
314
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
314
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
314
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
314
    }
705
314
    _closed = true;
706
314
    return Status::OK();
707
314
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
2.95k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
2.95k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
2.95k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
2.95k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
2.95k
    }
705
2.95k
    _closed = true;
706
2.95k
    return Status::OK();
707
2.95k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
12.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
12.6k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
12.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
12.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
12.6k
    }
705
12.6k
    _closed = true;
706
12.6k
    return Status::OK();
707
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_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_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
437k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
437k
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
437k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
437k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
437k
    }
705
437k
    _closed = true;
706
437k
    return Status::OK();
707
437k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
698
108
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
699
108
    if (_closed) {
700
0
        return Status::OK();
701
0
    }
702
108
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
703
108
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
704
108
    }
705
108
    _closed = true;
706
108
    return Status::OK();
707
108
}
_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
5.36k
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
711
5.36k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
712
5.36k
    return pull(state, block, eos);
713
5.36k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
710
32
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
711
32
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
712
32
    return pull(state, block, eos);
713
32
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
710
5.33k
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
711
5.33k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
712
5.33k
    return pull(state, block, eos);
713
5.33k
}
714
715
template <typename LocalStateType>
716
30.9M
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
717
30.9M
    auto& local_state = get_local_state(state);
718
30.9M
    if (need_more_input_data(state)) {
719
685k
        local_state._child_block->clear_column_data(
720
685k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
721
685k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
722
685k
                state, local_state._child_block.get(), &local_state._child_eos));
723
685k
        *eos = local_state._child_eos;
724
685k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
725
45.2k
            return Status::OK();
726
45.2k
        }
727
640k
        {
728
640k
            SCOPED_TIMER(local_state.exec_time_counter());
729
640k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
730
640k
        }
731
640k
    }
732
733
30.8M
    if (!need_more_input_data(state)) {
734
30.8M
        SCOPED_TIMER(local_state.exec_time_counter());
735
30.8M
        bool new_eos = false;
736
30.8M
        RETURN_IF_ERROR(pull(state, block, &new_eos));
737
30.8M
        if (new_eos) {
738
607k
            *eos = true;
739
30.2M
        } else if (!need_more_input_data(state)) {
740
30.1M
            *eos = false;
741
30.1M
        }
742
30.8M
    }
743
30.8M
    return Status::OK();
744
30.8M
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
716
174k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
717
174k
    auto& local_state = get_local_state(state);
718
174k
    if (need_more_input_data(state)) {
719
113k
        local_state._child_block->clear_column_data(
720
113k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
721
113k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
722
113k
                state, local_state._child_block.get(), &local_state._child_eos));
723
113k
        *eos = local_state._child_eos;
724
113k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
725
20.5k
            return Status::OK();
726
20.5k
        }
727
93.3k
        {
728
93.3k
            SCOPED_TIMER(local_state.exec_time_counter());
729
93.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
730
93.3k
        }
731
93.3k
    }
732
733
154k
    if (!need_more_input_data(state)) {
734
154k
        SCOPED_TIMER(local_state.exec_time_counter());
735
154k
        bool new_eos = false;
736
154k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
737
154k
        if (new_eos) {
738
110k
            *eos = true;
739
110k
        } else if (!need_more_input_data(state)) {
740
10.5k
            *eos = false;
741
10.5k
        }
742
154k
    }
743
154k
    return Status::OK();
744
154k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
716
3.31k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
717
3.31k
    auto& local_state = get_local_state(state);
718
3.31k
    if (need_more_input_data(state)) {
719
1.97k
        local_state._child_block->clear_column_data(
720
1.97k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
721
1.97k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
722
1.97k
                state, local_state._child_block.get(), &local_state._child_eos));
723
1.97k
        *eos = local_state._child_eos;
724
1.97k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
725
296
            return Status::OK();
726
296
        }
727
1.68k
        {
728
1.68k
            SCOPED_TIMER(local_state.exec_time_counter());
729
1.68k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
730
1.68k
        }
731
1.68k
    }
732
733
3.04k
    if (!need_more_input_data(state)) {
734
3.04k
        SCOPED_TIMER(local_state.exec_time_counter());
735
3.04k
        bool new_eos = false;
736
3.04k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
737
3.04k
        if (new_eos) {
738
1.35k
            *eos = true;
739
1.68k
        } else if (!need_more_input_data(state)) {
740
1.35k
            *eos = false;
741
1.35k
        }
742
3.04k
    }
743
3.02k
    return Status::OK();
744
3.02k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
716
1.55k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
717
1.55k
    auto& local_state = get_local_state(state);
718
1.55k
    if (need_more_input_data(state)) {
719
1.55k
        local_state._child_block->clear_column_data(
720
1.55k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
721
1.55k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
722
1.55k
                state, local_state._child_block.get(), &local_state._child_eos));
723
1.55k
        *eos = local_state._child_eos;
724
1.55k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
725
639
            return Status::OK();
726
639
        }
727
915
        {
728
915
            SCOPED_TIMER(local_state.exec_time_counter());
729
915
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
730
915
        }
731
915
    }
732
733
915
    if (!need_more_input_data(state)) {
734
915
        SCOPED_TIMER(local_state.exec_time_counter());
735
915
        bool new_eos = false;
736
915
        RETURN_IF_ERROR(pull(state, block, &new_eos));
737
915
        if (new_eos) {
738
670
            *eos = true;
739
670
        } else if (!need_more_input_data(state)) {
740
0
            *eos = false;
741
0
        }
742
915
    }
743
915
    return Status::OK();
744
915
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
716
18.5k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
717
18.5k
    auto& local_state = get_local_state(state);
718
18.5k
    if (need_more_input_data(state)) {
719
18.5k
        local_state._child_block->clear_column_data(
720
18.5k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
721
18.5k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
722
18.5k
                state, local_state._child_block.get(), &local_state._child_eos));
723
18.5k
        *eos = local_state._child_eos;
724
18.5k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
725
4.57k
            return Status::OK();
726
4.57k
        }
727
13.9k
        {
728
13.9k
            SCOPED_TIMER(local_state.exec_time_counter());
729
13.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
730
13.9k
        }
731
13.9k
    }
732
733
13.9k
    if (!need_more_input_data(state)) {
734
7.91k
        SCOPED_TIMER(local_state.exec_time_counter());
735
7.91k
        bool new_eos = false;
736
7.91k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
737
7.91k
        if (new_eos) {
738
7.76k
            *eos = true;
739
7.76k
        } else if (!need_more_input_data(state)) {
740
38
            *eos = false;
741
38
        }
742
7.91k
    }
743
13.9k
    return Status::OK();
744
13.9k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
716
527k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
717
527k
    auto& local_state = get_local_state(state);
718
528k
    if (need_more_input_data(state)) {
719
528k
        local_state._child_block->clear_column_data(
720
528k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
721
528k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
722
528k
                state, local_state._child_block.get(), &local_state._child_eos));
723
528k
        *eos = local_state._child_eos;
724
528k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
725
17.2k
            return Status::OK();
726
17.2k
        }
727
511k
        {
728
511k
            SCOPED_TIMER(local_state.exec_time_counter());
729
511k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
730
511k
        }
731
511k
    }
732
733
510k
    if (!need_more_input_data(state)) {
734
477k
        SCOPED_TIMER(local_state.exec_time_counter());
735
477k
        bool new_eos = false;
736
477k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
737
477k
        if (new_eos) {
738
476k
            *eos = true;
739
476k
        } else if (!need_more_input_data(state)) {
740
0
            *eos = false;
741
0
        }
742
477k
    }
743
510k
    return Status::OK();
744
510k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
716
30.1M
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
717
30.1M
    auto& local_state = get_local_state(state);
718
30.1M
    if (need_more_input_data(state)) {
719
15.9k
        local_state._child_block->clear_column_data(
720
15.9k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
721
15.9k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
722
15.9k
                state, local_state._child_block.get(), &local_state._child_eos));
723
15.9k
        *eos = local_state._child_eos;
724
15.9k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
725
1.62k
            return Status::OK();
726
1.62k
        }
727
14.3k
        {
728
14.3k
            SCOPED_TIMER(local_state.exec_time_counter());
729
14.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
730
14.3k
        }
731
14.3k
    }
732
733
30.1M
    if (!need_more_input_data(state)) {
734
30.1M
        SCOPED_TIMER(local_state.exec_time_counter());
735
30.1M
        bool new_eos = false;
736
30.1M
        RETURN_IF_ERROR(pull(state, block, &new_eos));
737
30.1M
        if (new_eos) {
738
7.39k
            *eos = true;
739
30.1M
        } else if (!need_more_input_data(state)) {
740
30.1M
            *eos = false;
741
30.1M
        }
742
30.1M
    }
743
30.1M
    return Status::OK();
744
30.1M
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
716
5.42k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
717
5.42k
    auto& local_state = get_local_state(state);
718
5.42k
    if (need_more_input_data(state)) {
719
5.05k
        local_state._child_block->clear_column_data(
720
5.05k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
721
5.05k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
722
5.05k
                state, local_state._child_block.get(), &local_state._child_eos));
723
5.05k
        *eos = local_state._child_eos;
724
5.05k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
725
281
            return Status::OK();
726
281
        }
727
4.77k
        {
728
4.77k
            SCOPED_TIMER(local_state.exec_time_counter());
729
4.77k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
730
4.77k
        }
731
4.77k
    }
732
733
5.14k
    if (!need_more_input_data(state)) {
734
5.14k
        SCOPED_TIMER(local_state.exec_time_counter());
735
5.14k
        bool new_eos = false;
736
5.14k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
737
5.14k
        if (new_eos) {
738
3.29k
            *eos = true;
739
3.29k
        } else if (!need_more_input_data(state)) {
740
374
            *eos = false;
741
374
        }
742
5.14k
    }
743
5.14k
    return Status::OK();
744
5.14k
}
745
746
template <typename Writer, typename Parent>
747
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
748
67.4k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
749
67.4k
    RETURN_IF_ERROR(Base::init(state, info));
750
67.4k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
751
67.4k
                                                         "AsyncWriterDependency", true);
752
67.4k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
753
67.4k
                             _finish_dependency));
754
755
67.4k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
756
67.4k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
757
67.4k
    return Status::OK();
758
67.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
748
359
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
749
359
    RETURN_IF_ERROR(Base::init(state, info));
750
359
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
751
359
                                                         "AsyncWriterDependency", true);
752
359
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
753
359
                             _finish_dependency));
754
755
359
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
756
359
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
757
359
    return Status::OK();
758
359
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
748
66.9k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
749
66.9k
    RETURN_IF_ERROR(Base::init(state, info));
750
66.9k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
751
66.9k
                                                         "AsyncWriterDependency", true);
752
66.9k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
753
66.9k
                             _finish_dependency));
754
755
66.9k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
756
66.9k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
757
66.9k
    return Status::OK();
758
66.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
748
128
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
749
128
    RETURN_IF_ERROR(Base::init(state, info));
750
128
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
751
128
                                                         "AsyncWriterDependency", true);
752
128
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
753
128
                             _finish_dependency));
754
755
128
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
756
128
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
757
128
    return Status::OK();
758
128
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
759
760
template <typename Writer, typename Parent>
761
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
762
68.0k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
763
68.0k
    RETURN_IF_ERROR(Base::open(state));
764
68.0k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
765
476k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
766
408k
        RETURN_IF_ERROR(
767
408k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
768
408k
    }
769
68.0k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
770
68.0k
    return Status::OK();
771
68.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
762
361
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
763
361
    RETURN_IF_ERROR(Base::open(state));
764
361
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
765
1.84k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
766
1.48k
        RETURN_IF_ERROR(
767
1.48k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
768
1.48k
    }
769
361
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
770
361
    return Status::OK();
771
361
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
762
67.6k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
763
67.6k
    RETURN_IF_ERROR(Base::open(state));
764
67.6k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
765
472k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
766
404k
        RETURN_IF_ERROR(
767
404k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
768
404k
    }
769
67.6k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
770
67.6k
    return Status::OK();
771
67.6k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
762
128
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
763
128
    RETURN_IF_ERROR(Base::open(state));
764
128
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
765
2.30k
    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
128
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
770
128
    return Status::OK();
771
128
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
772
773
template <typename Writer, typename Parent>
774
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
775
80.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
776
80.4k
    return _writer->sink(block, eos);
777
80.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
775
1.37k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
776
1.37k
    return _writer->sink(block, eos);
777
1.37k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
775
78.9k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
776
78.9k
    return _writer->sink(block, eos);
777
78.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
775
128
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
776
128
    return _writer->sink(block, eos);
777
128
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
778
779
template <typename Writer, typename Parent>
780
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
781
68.2k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
782
68.2k
    if (_closed) {
783
0
        return Status::OK();
784
0
    }
785
68.2k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
786
68.2k
    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
68.2k
    if (_writer) {
789
68.2k
        Status st = _writer->get_writer_status();
790
68.2k
        if (exec_status.ok()) {
791
68.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
792
68.1k
                                                       : Status::Cancelled("force close"));
793
68.1k
        } else {
794
95
            _writer->force_close(exec_status);
795
95
        }
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
68.2k
        RETURN_IF_ERROR(st);
800
68.2k
    }
801
68.1k
    return Base::close(state, exec_status);
802
68.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
781
349
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
782
349
    if (_closed) {
783
0
        return Status::OK();
784
0
    }
785
349
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
786
349
    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
349
    if (_writer) {
789
349
        Status st = _writer->get_writer_status();
790
349
        if (exec_status.ok()) {
791
349
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
792
349
                                                       : Status::Cancelled("force close"));
793
349
        } 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
349
        RETURN_IF_ERROR(st);
800
349
    }
801
349
    return Base::close(state, exec_status);
802
349
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
781
67.7k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
782
67.7k
    if (_closed) {
783
0
        return Status::OK();
784
0
    }
785
67.7k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
786
67.7k
    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
67.7k
    if (_writer) {
789
67.7k
        Status st = _writer->get_writer_status();
790
67.7k
        if (exec_status.ok()) {
791
67.6k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
792
67.6k
                                                       : Status::Cancelled("force close"));
793
67.6k
        } else {
794
95
            _writer->force_close(exec_status);
795
95
        }
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
67.7k
        RETURN_IF_ERROR(st);
800
67.7k
    }
801
67.6k
    return Base::close(state, exec_status);
802
67.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
781
128
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
782
128
    if (_closed) {
783
0
        return Status::OK();
784
0
    }
785
128
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
786
128
    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
128
    if (_writer) {
789
128
        Status st = _writer->get_writer_status();
790
128
        if (exec_status.ok()) {
791
128
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
792
128
                                                       : Status::Cancelled("force close"));
793
128
        } 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
128
        RETURN_IF_ERROR(st);
800
128
    }
801
128
    return Base::close(state, exec_status);
802
128
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
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