Coverage Report

Created: 2026-09-24 14:26

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