Coverage Report

Created: 2026-09-24 09:38

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.59M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.59M
    if (_parent->nereids_id() == -1) {
122
817k
        return fmt::format("(id={})", _parent->node_id());
123
817k
    } else {
124
773k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
773k
    }
126
1.59M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
66.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
66.6k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
66.6k
    } else {
124
66.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
66.6k
    }
126
66.6k
}
_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
203k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
203k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
203k
    } else {
124
203k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
203k
    }
126
203k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
26
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
26
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.16k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.16k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
6.16k
    } else {
124
6.16k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.16k
    }
126
6.16k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.22k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.22k
    if (_parent->nereids_id() == -1) {
122
14
        return fmt::format("(id={})", _parent->node_id());
123
8.21k
    } else {
124
8.21k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.21k
    }
126
8.22k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
95.5k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
95.5k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
95.4k
    } else {
124
95.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
95.4k
    }
126
95.5k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.0k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
54.0k
    } else {
124
54.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.0k
    }
126
54.0k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
193
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
193
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
193
    } else {
124
193
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
193
    }
126
193
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
525k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
525k
    if (_parent->nereids_id() == -1) {
122
246k
        return fmt::format("(id={})", _parent->node_id());
123
279k
    } else {
124
279k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
279k
    }
126
525k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.6k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.6k
    } else {
124
54.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.6k
    }
126
54.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.98k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.98k
    if (_parent->nereids_id() == -1) {
122
5.98k
        return fmt::format("(id={})", _parent->node_id());
123
5.98k
    } else {
124
8
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8
    }
126
5.98k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
428
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
428
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
326
    } else {
124
326
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
326
    }
126
428
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.88k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.88k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
4.87k
    } else {
124
4.87k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4.87k
    }
126
4.88k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
564k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
564k
    if (_parent->nereids_id() == -1) {
122
564k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
564k
}
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.11M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.11M
    if (_parent->nereids_id() == -1) {
131
613k
        return fmt::format("(id={})", _parent->node_id());
132
613k
    } else {
133
497k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
497k
    }
135
1.11M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
114k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
114k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
114k
    } else {
133
114k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
114k
    }
135
114k
}
_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
208k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
208k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
208k
    } else {
133
208k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
208k
    }
135
208k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
33
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
33
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
33
    } else {
133
33
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
33
    }
135
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
6.16k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6.16k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
6.16k
    } else {
133
6.16k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
6.16k
    }
135
6.16k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.31k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.31k
    if (_parent->nereids_id() == -1) {
131
14
        return fmt::format("(id={})", _parent->node_id());
132
8.30k
    } else {
133
8.30k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.30k
    }
135
8.31k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
96.2k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
96.2k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
96.2k
    } else {
133
96.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
96.2k
    }
135
96.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
53.7k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
53.7k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
53.7k
    } else {
133
53.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
53.7k
    }
135
53.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
203
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
203
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
203
    } else {
133
203
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
203
    }
135
203
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
21
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
21
    if (_parent->nereids_id() == -1) {
131
21
        return fmt::format("(id={})", _parent->node_id());
132
21
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
21
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.95k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.95k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
8.95k
    } else {
133
8.95k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.95k
    }
135
8.95k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
427
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
427
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
325
    } else {
133
325
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
325
    }
135
427
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.3k
    if (_parent->nereids_id() == -1) {
131
12.3k
        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.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
223k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
224k
    if (_parent->nereids_id() == -1) {
131
224k
        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
223k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
376k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
376k
    if (_parent->nereids_id() == -1) {
131
376k
        return fmt::format("(id={})", _parent->node_id());
132
376k
    } else {
133
589
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
589
    }
135
376k
}
_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.9k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
30.9k
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
30.9k
    _terminated = true;
143
30.9k
    return Status::OK();
144
30.9k
}
_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
2.45k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.45k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.45k
    _terminated = true;
143
2.45k
    return Status::OK();
144
2.45k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_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.76k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.76k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.76k
    _terminated = true;
143
1.76k
    return Status::OK();
144
1.76k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.22k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.22k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.22k
    _terminated = true;
143
1.22k
    return Status::OK();
144
1.22k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
641
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
641
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
640
    _terminated = true;
143
640
    return Status::OK();
144
641
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
140
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
140
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
140
    _terminated = true;
143
140
    return Status::OK();
144
140
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
9
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
9
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
9
    _terminated = true;
143
9
    return Status::OK();
144
9
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
244
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
244
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
244
    _terminated = true;
143
244
    return Status::OK();
144
244
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
26
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
26
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
26
    _terminated = true;
143
26
    return Status::OK();
144
26
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
317
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
317
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
317
    _terminated = true;
143
317
    return Status::OK();
144
317
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
136
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
136
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
136
    _terminated = true;
143
136
    return Status::OK();
144
136
}
145
146
301k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
301k
    return _child && _child->is_serial_operator() && !is_source()
148
301k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
301k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
301k
}
151
152
21.8k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
21.8k
    if (!_child) {
154
20.4k
        return false;
155
20.4k
    }
156
1.36k
    if (_child->is_serial_operator()) {
157
196
        return true;
158
196
    }
159
1.17k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.17k
    return child_distribution.need_local_exchange() &&
161
1.17k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.36k
}
163
164
template <typename SharedStateArg>
165
15.7k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
15.7k
    fmt::memory_buffer debug_string_buffer;
167
15.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
15.7k
    return fmt::to_string(debug_string_buffer);
169
15.7k
}
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.7k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
15.7k
    fmt::memory_buffer debug_string_buffer;
167
15.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
15.7k
    return fmt::to_string(debug_string_buffer);
169
15.7k
}
_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.7k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
15.7k
    fmt::memory_buffer debug_string_buffer;
174
15.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
15.7k
    return fmt::to_string(debug_string_buffer);
176
15.7k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
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.7k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
15.7k
    fmt::memory_buffer debug_string_buffer;
174
15.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
15.7k
    return fmt::to_string(debug_string_buffer);
176
15.7k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
15.7k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
15.7k
    fmt::memory_buffer debug_string_buffer;
180
15.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
15.7k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
15.7k
                   _is_serial_operator);
183
15.7k
    return fmt::to_string(debug_string_buffer);
184
15.7k
}
185
186
15.7k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
15.7k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
15.7k
}
189
190
645k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
645k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
645k
    _nereids_id = tnode.nereids_id;
193
645k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.89k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.89k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.89k
            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
3.89k
    }
206
645k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
645k
    _op_name = substr + "_OPERATOR";
208
209
645k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
645k
    } else if (tnode.__isset.conjuncts) {
212
272k
        for (const auto& conjunct : tnode.conjuncts) {
213
272k
            VExprContextSPtr context;
214
272k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
272k
            _conjuncts.emplace_back(context);
216
272k
        }
217
99.3k
    }
218
219
    // create the projections expr
220
645k
    if (tnode.__isset.projections) {
221
261k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
261k
    }
223
645k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.89k
        DCHECK(has_projection()) << "no final projections";
225
3.89k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.61k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.61k
            VExprContextSPtrs projections;
228
6.61k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.61k
            _projection->intermediate_projections.push_back(projections);
230
6.61k
        }
231
3.89k
    }
232
645k
    return Status::OK();
233
645k
}
234
235
673k
Status OperatorXBase::prepare(RuntimeState* state) {
236
673k
    for (auto& conjunct : _conjuncts) {
237
272k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
272k
    }
239
673k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
622k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
338k
            return a->execute_cost() < b->execute_cost();
242
338k
        });
243
622k
    };
244
245
673k
    if (has_projection()) {
246
261k
        auto& projection = *_projection;
247
268k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.61k
            const auto& input_row_desc =
249
6.61k
                    i == 0 ? operator_row_desc_before_projection()
250
6.61k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.61k
            RETURN_IF_ERROR(
252
6.61k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.61k
        }
254
261k
        const auto& final_projection_input_row_desc =
255
261k
                projection.intermediate_output_row_descriptors.empty()
256
261k
                        ? operator_row_desc_before_projection()
257
261k
                        : projection.intermediate_output_row_descriptors.back();
258
261k
        RETURN_IF_ERROR(
259
261k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
261k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
261k
                                                      projection.output_row_descriptor));
262
261k
    }
263
264
673k
    for (auto& conjunct : _conjuncts) {
265
272k
        RETURN_IF_ERROR(conjunct->open(state));
266
272k
    }
267
673k
    if (has_projection()) {
268
261k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
261k
        for (auto& projections : _projection->intermediate_projections) {
270
6.61k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.61k
        }
272
261k
    }
273
673k
    if (_child && !is_source()) {
274
92.7k
        RETURN_IF_ERROR(_child->prepare(state));
275
92.7k
    }
276
277
673k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
673k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
673k
    return Status::OK();
283
673k
}
284
285
7.55k
Status OperatorXBase::terminate(RuntimeState* state) {
286
7.55k
    if (_child && !is_source()) {
287
574
        RETURN_IF_ERROR(_child->terminate(state));
288
574
    }
289
7.55k
    auto result = state->get_local_state_result(operator_id());
290
7.55k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
7.55k
    return result.value()->terminate(state);
294
7.55k
}
295
296
4.36M
Status OperatorXBase::close(RuntimeState* state) {
297
4.36M
    if (_child && !is_source()) {
298
684k
        RETURN_IF_ERROR(_child->close(state));
299
684k
    }
300
4.36M
    auto result = state->get_local_state_result(operator_id());
301
4.36M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.36M
    return result.value()->close(state);
305
4.36M
}
306
307
279k
void PipelineXLocalStateBase::clear_origin_block() {
308
279k
    _origin_block.clear_column_data(
309
279k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
279k
}
311
312
575k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
575k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
575k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
575k
    return Status::OK();
317
575k
}
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
279k
                                     Block* output_block) const {
326
279k
    auto* local_state = state->get_local_state(operator_id());
327
279k
    SCOPED_TIMER(local_state->exec_time_counter());
328
279k
    SCOPED_TIMER(local_state->_projection_timer);
329
279k
    const size_t rows = origin_block->rows();
330
279k
    if (rows == 0) {
331
146k
        return Status::OK();
332
146k
    }
333
132k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
132k
    {
336
132k
        Block input_block = *origin_block;
337
338
132k
        ColumnsWithTypeAndName new_columns;
339
132k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.64k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.64k
            new_columns.resize(projections.size());
345
70.2k
            for (int i = 0; i < projections.size(); i++) {
346
66.6k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
66.6k
                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
66.6k
            }
355
3.63k
            Block tmp_block {new_columns};
356
3.63k
            input_block.swap(tmp_block);
357
3.63k
        }
358
359
132k
        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
132k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
132k
                output_block, _projection->output_row_descriptor);
368
132k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
132k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
132k
        Columns shared_columns(mutable_columns.size());
371
372
761k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
629k
            ColumnPtr column_ptr;
374
629k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
629k
            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
629k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
629k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
629k
            if (column_ptr->is_exclusive()) {
386
227k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
401k
            } else {
388
401k
                shared_columns[i] = std::move(column_ptr);
389
401k
            }
390
629k
        }
391
392
132k
        scoped_mutable_block.restore();
393
761k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
629k
            if (shared_columns[i]) {
395
401k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
401k
            }
397
629k
        }
398
132k
    }
399
400
0
    origin_block->clear_column_data(
401
132k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
132k
    DCHECK_EQ(output_block->rows(), rows);
403
404
132k
    return Status::OK();
405
132k
}
406
407
3.85M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
3.85M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
3.85M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
3.85M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
3.85M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
3.85M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
3.85M
            if (_debug_point_count++ % 2 == 0) {
414
3.85M
                return Status::OK();
415
3.85M
            }
416
3.85M
        }
417
3.85M
    });
418
419
3.85M
    Status status;
420
3.85M
    auto* local_state = state->get_local_state(operator_id());
421
3.85M
    Defer defer([&]() {
422
3.85M
        if (status.ok()) {
423
3.85M
            local_state->update_output_block_counters(*block);
424
3.85M
        }
425
3.85M
    });
426
3.85M
    if (has_projection()) {
427
279k
        local_state->clear_origin_block();
428
279k
        status = get_block(state, &local_state->_origin_block, eos);
429
279k
        if (UNLIKELY(!status.ok())) {
430
30
            return status;
431
30
        }
432
279k
        status = do_projections(state, &local_state->_origin_block, block);
433
279k
        return status;
434
279k
    }
435
3.57M
    status = get_block(state, block, eos);
436
3.57M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.57M
    return status;
438
3.57M
}
439
440
2.53M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.53M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.65k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.65k
        *eos = true;
444
9.65k
    }
445
446
2.53M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.53M
        auto op_name = to_lower(_parent->_op_name);
448
2.53M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.53M
        arg_op_name = to_lower(arg_op_name);
450
451
2.53M
        if (op_name == arg_op_name) {
452
2.53M
            *eos = true;
453
2.53M
        }
454
2.53M
    });
455
456
2.53M
    if (auto rows = block->rows()) {
457
737k
        _num_rows_returned += rows;
458
737k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
737k
    }
460
2.53M
}
461
462
30.9k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
30.9k
    auto result = state->get_sink_local_state_result();
464
30.9k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
30.9k
    return result.value()->terminate(state);
468
30.9k
}
469
470
15.7k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
15.7k
    fmt::memory_buffer debug_string_buffer;
472
473
15.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
15.7k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
15.7k
    return fmt::to_string(debug_string_buffer);
476
15.7k
}
477
478
15.7k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
15.7k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
15.7k
}
481
482
340k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
340k
    std::string op_name = "UNKNOWN_SINK";
484
340k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
341k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
341k
        op_name = it->second;
488
341k
    }
489
340k
    _name = op_name + "_OPERATOR";
490
340k
    return Status::OK();
491
340k
}
492
493
285k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
285k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
285k
    _nereids_id = tnode.nereids_id;
496
285k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
285k
    _name = substr + "_SINK_OPERATOR";
498
285k
    return Status::OK();
499
285k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.58M
                                                            LocalSinkStateInfo& info) {
504
1.58M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.58M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.58M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.58M
    return Status::OK();
508
1.58M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
114k
                                                            LocalSinkStateInfo& info) {
504
114k
    auto local_state = LocalStateType::create_unique(this, state);
505
114k
    RETURN_IF_ERROR(local_state->init(state, info));
506
114k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
114k
    return Status::OK();
508
114k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
332k
                                                            LocalSinkStateInfo& info) {
504
332k
    auto local_state = LocalStateType::create_unique(this, state);
505
332k
    RETURN_IF_ERROR(local_state->init(state, info));
506
332k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
332k
    return Status::OK();
508
332k
}
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
359
                                                            LocalSinkStateInfo& info) {
504
359
    auto local_state = LocalStateType::create_unique(this, state);
505
359
    RETURN_IF_ERROR(local_state->init(state, info));
506
359
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
359
    return Status::OK();
508
359
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
45.9k
                                                            LocalSinkStateInfo& info) {
504
45.9k
    auto local_state = LocalStateType::create_unique(this, state);
505
45.9k
    RETURN_IF_ERROR(local_state->init(state, info));
506
45.9k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
45.9k
    return Status::OK();
508
45.9k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
44
                                                            LocalSinkStateInfo& info) {
504
44
    auto local_state = LocalStateType::create_unique(this, state);
505
44
    RETURN_IF_ERROR(local_state->init(state, info));
506
44
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
44
    return Status::OK();
508
44
}
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
8.31k
                                                            LocalSinkStateInfo& info) {
504
8.31k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.31k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.31k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.31k
    return Status::OK();
508
8.31k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
18
                                                            LocalSinkStateInfo& info) {
504
18
    auto local_state = LocalStateType::create_unique(this, state);
505
18
    RETURN_IF_ERROR(local_state->init(state, info));
506
18
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
18
    return Status::OK();
508
18
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
208k
                                                            LocalSinkStateInfo& info) {
504
208k
    auto local_state = LocalStateType::create_unique(this, state);
505
208k
    RETURN_IF_ERROR(local_state->init(state, info));
506
208k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
208k
    return Status::OK();
508
208k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
33
                                                            LocalSinkStateInfo& info) {
504
33
    auto local_state = LocalStateType::create_unique(this, state);
505
33
    RETURN_IF_ERROR(local_state->init(state, info));
506
33
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
33
    return Status::OK();
508
33
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
224k
                                                            LocalSinkStateInfo& info) {
504
224k
    auto local_state = LocalStateType::create_unique(this, state);
505
224k
    RETURN_IF_ERROR(local_state->init(state, info));
506
224k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
224k
    return Status::OK();
508
224k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
96.3k
                                                            LocalSinkStateInfo& info) {
504
96.3k
    auto local_state = LocalStateType::create_unique(this, state);
505
96.3k
    RETURN_IF_ERROR(local_state->init(state, info));
506
96.3k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
96.3k
    return Status::OK();
508
96.3k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
53.8k
                                                            LocalSinkStateInfo& info) {
504
53.8k
    auto local_state = LocalStateType::create_unique(this, state);
505
53.8k
    RETURN_IF_ERROR(local_state->init(state, info));
506
53.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
53.8k
    return Status::OK();
508
53.8k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
203
                                                            LocalSinkStateInfo& info) {
504
203
    auto local_state = LocalStateType::create_unique(this, state);
505
203
    RETURN_IF_ERROR(local_state->init(state, info));
506
203
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
203
    return Status::OK();
508
203
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
469k
                                                            LocalSinkStateInfo& info) {
504
469k
    auto local_state = LocalStateType::create_unique(this, state);
505
469k
    RETURN_IF_ERROR(local_state->init(state, info));
506
469k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
469k
    return Status::OK();
508
469k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.16k
                                                            LocalSinkStateInfo& info) {
504
6.16k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.16k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.16k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.16k
    return Status::OK();
508
6.16k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.94k
                                                            LocalSinkStateInfo& info) {
504
8.94k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.94k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.94k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.94k
    return Status::OK();
508
8.94k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.48k
                                                            LocalSinkStateInfo& info) {
504
2.48k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.48k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.48k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.48k
    return Status::OK();
508
2.48k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
326
                                                            LocalSinkStateInfo& info) {
504
326
    auto local_state = LocalStateType::create_unique(this, state);
505
326
    RETURN_IF_ERROR(local_state->init(state, info));
506
326
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
326
    return Status::OK();
508
326
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.75k
                                                            LocalSinkStateInfo& info) {
504
4.75k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.75k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.75k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.75k
    return Status::OK();
508
4.75k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.51k
                                                            LocalSinkStateInfo& info) {
504
2.51k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.51k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.51k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.51k
    return Status::OK();
508
2.51k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.58k
                                                            LocalSinkStateInfo& info) {
504
2.58k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.58k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.58k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.58k
    return Status::OK();
508
2.58k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.46k
                                                            LocalSinkStateInfo& info) {
504
2.46k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.46k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.46k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.46k
    return Status::OK();
508
2.46k
}
_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
564
                                                            LocalSinkStateInfo& info) {
504
564
    auto local_state = LocalStateType::create_unique(this, state);
505
564
    RETURN_IF_ERROR(local_state->init(state, info));
506
564
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
564
    return Status::OK();
508
564
}
_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
106
                                                            LocalSinkStateInfo& info) {
504
106
    auto local_state = LocalStateType::create_unique(this, state);
505
106
    RETURN_IF_ERROR(local_state->init(state, info));
506
106
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
106
    return Status::OK();
508
106
}
_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.28M
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.28M
    } else {
519
1.28M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.28M
        ss->id = operator_id();
521
1.28M
        for (auto& dest : dests_id()) {
522
1.27M
            ss->related_op_ids.insert(dest);
523
1.27M
        }
524
1.28M
        return ss;
525
1.28M
    }
526
1.28M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_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
101k
            ss->related_op_ids.insert(dest);
523
101k
        }
524
102k
        return ss;
525
102k
    }
526
102k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
332k
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
332k
    } else {
519
332k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
332k
        ss->id = operator_id();
521
332k
        for (auto& dest : dests_id()) {
522
329k
            ss->related_op_ids.insert(dest);
523
329k
        }
524
332k
        return ss;
525
332k
    }
526
332k
}
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
359
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
359
    } else {
519
359
        auto ss = LocalStateType::SharedStateType::create_shared();
520
359
        ss->id = operator_id();
521
359
        for (auto& dest : dests_id()) {
522
358
            ss->related_op_ids.insert(dest);
523
358
        }
524
359
        return ss;
525
359
    }
526
359
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46.1k
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.1k
    } else {
519
46.1k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46.1k
        ss->id = operator_id();
521
46.1k
        for (auto& dest : dests_id()) {
522
45.7k
            ss->related_op_ids.insert(dest);
523
45.7k
        }
524
46.1k
        return ss;
525
46.1k
    }
526
46.1k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
44
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
44
    } else {
519
44
        auto ss = LocalStateType::SharedStateType::create_shared();
520
44
        ss->id = operator_id();
521
44
        for (auto& dest : dests_id()) {
522
44
            ss->related_op_ids.insert(dest);
523
44
        }
524
44
        return ss;
525
44
    }
526
44
}
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
8.33k
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
8.33k
    } else {
519
8.33k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.33k
        ss->id = operator_id();
521
8.33k
        for (auto& dest : dests_id()) {
522
8.32k
            ss->related_op_ids.insert(dest);
523
8.32k
        }
524
8.33k
        return ss;
525
8.33k
    }
526
8.33k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
18
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
18
    } else {
519
18
        auto ss = LocalStateType::SharedStateType::create_shared();
520
18
        ss->id = operator_id();
521
18
        for (auto& dest : dests_id()) {
522
18
            ss->related_op_ids.insert(dest);
523
18
        }
524
18
        return ss;
525
18
    }
526
18
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
210k
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
210k
    } else {
519
210k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
210k
        ss->id = operator_id();
521
210k
        for (auto& dest : dests_id()) {
522
210k
            ss->related_op_ids.insert(dest);
523
210k
        }
524
210k
        return ss;
525
210k
    }
526
210k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
35
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
35
    } else {
519
35
        auto ss = LocalStateType::SharedStateType::create_shared();
520
35
        ss->id = operator_id();
521
35
        for (auto& dest : dests_id()) {
522
35
            ss->related_op_ids.insert(dest);
523
35
        }
524
35
        return ss;
525
35
    }
526
35
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
96.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
96.6k
    } else {
519
96.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
96.6k
        ss->id = operator_id();
521
96.7k
        for (auto& dest : dests_id()) {
522
96.7k
            ss->related_op_ids.insert(dest);
523
96.7k
        }
524
96.6k
        return ss;
525
96.6k
    }
526
96.6k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
202
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
202
    } else {
519
202
        auto ss = LocalStateType::SharedStateType::create_shared();
520
202
        ss->id = operator_id();
521
202
        for (auto& dest : dests_id()) {
522
202
            ss->related_op_ids.insert(dest);
523
202
        }
524
202
        return ss;
525
202
    }
526
202
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
472k
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
472k
    } else {
519
472k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
472k
        ss->id = operator_id();
521
472k
        for (auto& dest : dests_id()) {
522
469k
            ss->related_op_ids.insert(dest);
523
469k
        }
524
472k
        return ss;
525
472k
    }
526
472k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.18k
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
6.18k
    } else {
519
6.18k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.18k
        ss->id = operator_id();
521
6.18k
        for (auto& dest : dests_id()) {
522
6.17k
            ss->related_op_ids.insert(dest);
523
6.17k
        }
524
6.18k
        return ss;
525
6.18k
    }
526
6.18k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
430
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
430
    } else {
519
430
        auto ss = LocalStateType::SharedStateType::create_shared();
520
430
        ss->id = operator_id();
521
431
        for (auto& dest : dests_id()) {
522
431
            ss->related_op_ids.insert(dest);
523
431
        }
524
430
        return ss;
525
430
    }
526
430
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.57k
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.57k
    } else {
519
2.57k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.57k
        ss->id = operator_id();
521
2.58k
        for (auto& dest : dests_id()) {
522
2.58k
            ss->related_op_ids.insert(dest);
523
2.58k
        }
524
2.57k
        return ss;
525
2.57k
    }
526
2.57k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.46k
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.46k
    } else {
519
2.46k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.46k
        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.46k
        return ss;
525
2.46k
    }
526
2.46k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
567
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
567
    } else {
519
567
        auto ss = LocalStateType::SharedStateType::create_shared();
520
567
        ss->id = operator_id();
521
567
        for (auto& dest : dests_id()) {
522
553
            ss->related_op_ids.insert(dest);
523
553
        }
524
567
        return ss;
525
567
    }
526
567
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
106
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
106
    } else {
519
106
        auto ss = LocalStateType::SharedStateType::create_shared();
520
106
        ss->id = operator_id();
521
106
        for (auto& dest : dests_id()) {
522
106
            ss->related_op_ids.insert(dest);
523
106
        }
524
106
        return ss;
525
106
    }
526
106
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.85M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.85M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.85M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.85M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.85M
    return Status::OK();
534
1.85M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
66.9k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
66.9k
    auto local_state = LocalStateType::create_unique(state, this);
531
66.9k
    RETURN_IF_ERROR(local_state->init(state, info));
532
66.9k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
66.9k
    return Status::OK();
534
66.9k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
242k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
242k
    auto local_state = LocalStateType::create_unique(state, this);
531
242k
    RETURN_IF_ERROR(local_state->init(state, info));
532
242k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
242k
    return Status::OK();
534
242k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
137
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
137
    auto local_state = LocalStateType::create_unique(state, this);
531
137
    RETURN_IF_ERROR(local_state->init(state, info));
532
137
    state->emplace_local_state(operator_id(), std::move(local_state));
533
137
    return Status::OK();
534
137
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.09k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.09k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.09k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.09k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.09k
    return Status::OK();
534
3.09k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.24k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.24k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.24k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.24k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.24k
    return Status::OK();
534
8.24k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.08k
    return Status::OK();
534
8.08k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
26
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
26
    auto local_state = LocalStateType::create_unique(state, this);
531
26
    RETURN_IF_ERROR(local_state->init(state, info));
532
26
    state->emplace_local_state(operator_id(), std::move(local_state));
533
26
    return Status::OK();
534
26
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
199k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
199k
    auto local_state = LocalStateType::create_unique(state, this);
531
199k
    RETURN_IF_ERROR(local_state->init(state, info));
532
199k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
199k
    return Status::OK();
534
199k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
96.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
96.2k
    auto local_state = LocalStateType::create_unique(state, this);
531
96.2k
    RETURN_IF_ERROR(local_state->init(state, info));
532
96.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
96.2k
    return Status::OK();
534
96.2k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
54.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.1k
    return Status::OK();
534
54.1k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
193
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
193
    auto local_state = LocalStateType::create_unique(state, this);
531
193
    RETURN_IF_ERROR(local_state->init(state, info));
532
193
    state->emplace_local_state(operator_id(), std::move(local_state));
533
193
    return Status::OK();
534
193
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.33k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.33k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.33k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.33k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.33k
    return Status::OK();
534
4.33k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
248k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
248k
    auto local_state = LocalStateType::create_unique(state, this);
531
248k
    RETURN_IF_ERROR(local_state->init(state, info));
532
248k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
248k
    return Status::OK();
534
248k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.31k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.31k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.31k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.31k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.31k
    return Status::OK();
534
1.31k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.15k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.15k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.15k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.15k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.15k
    return Status::OK();
534
6.15k
}
_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
54.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.7k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.7k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.7k
    return Status::OK();
534
54.7k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.99k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.99k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.99k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.99k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.99k
    return Status::OK();
534
5.99k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
326
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
326
    auto local_state = LocalStateType::create_unique(state, this);
531
326
    RETURN_IF_ERROR(local_state->init(state, info));
532
326
    state->emplace_local_state(operator_id(), std::move(local_state));
533
326
    return Status::OK();
534
326
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.56k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.56k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.56k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.56k
    return Status::OK();
534
2.56k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.45k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.45k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.45k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.45k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.45k
    return Status::OK();
534
2.45k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
385
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
385
    auto local_state = LocalStateType::create_unique(state, this);
531
385
    RETURN_IF_ERROR(local_state->init(state, info));
532
385
    state->emplace_local_state(operator_id(), std::move(local_state));
533
385
    return Status::OK();
534
385
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.67k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.67k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.67k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.67k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.67k
    return Status::OK();
534
1.67k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.4k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.4k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.4k
    return Status::OK();
534
10.4k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
573k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
573k
    auto local_state = LocalStateType::create_unique(state, this);
531
573k
    RETURN_IF_ERROR(local_state->init(state, info));
532
573k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
573k
    return Status::OK();
534
573k
}
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
795
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
795
    auto local_state = LocalStateType::create_unique(state, this);
531
795
    RETURN_IF_ERROR(local_state->init(state, info));
532
795
    state->emplace_local_state(operator_id(), std::move(local_state));
533
795
    return Status::OK();
534
795
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.22k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.22k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.22k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.22k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.22k
    return Status::OK();
534
1.22k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.04k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.04k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.04k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.04k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.04k
    return Status::OK();
534
7.04k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
251k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
251k
    auto local_state = LocalStateType::create_unique(state, this);
531
251k
    RETURN_IF_ERROR(local_state->init(state, info));
532
251k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
251k
    return Status::OK();
534
251k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.58M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.84M
        : _num_rows_returned(0),
542
1.84M
          _rows_returned_counter(nullptr),
543
1.84M
          _parent(parent),
544
1.84M
          _state(state),
545
1.84M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.86M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.86M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.86M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.86M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.86M
    _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.86M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.86M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.86M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.86M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.86M
    if constexpr (!is_fake_shared) {
560
1.08M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
632k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
632k
                                    .first.get()
563
632k
                                    ->template cast<SharedStateArg>();
564
565
632k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
632k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
632k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
632k
        } else if (info.shared_state) {
569
376k
            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
376k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
376k
            _dependency = _shared_state->create_source_dependency(
576
376k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
376k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
376k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
376k
        } else {
580
76.4k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
10.7k
                DCHECK(false);
582
10.7k
            }
583
76.4k
        }
584
1.08M
    }
585
586
1.86M
    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.86M
    _rows_returned_counter =
591
1.86M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.86M
    _blocks_returned_counter =
593
1.86M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.86M
    _output_block_bytes_counter =
595
1.86M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.86M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.86M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.86M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.86M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.86M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.86M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.86M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.86M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.86M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.86M
    _memory_used_counter =
606
1.86M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.86M
    _common_profile->add_info_string("IsColocate",
608
1.86M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.86M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.86M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.86M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.86M
    return Status::OK();
613
1.86M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
67.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
67.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
67.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
67.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
67.0k
    _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
67.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
67.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
67.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
67.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
67.0k
    if constexpr (!is_fake_shared) {
560
67.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
12.3k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
12.3k
                                    .first.get()
563
12.3k
                                    ->template cast<SharedStateArg>();
564
565
12.3k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
12.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
12.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.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
53.6k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
53.6k
            _dependency = _shared_state->create_source_dependency(
576
53.6k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
53.6k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
53.6k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
53.6k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.12k
        }
584
67.0k
    }
585
586
67.0k
    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
67.0k
    _rows_returned_counter =
591
67.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
67.0k
    _blocks_returned_counter =
593
67.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
67.0k
    _output_block_bytes_counter =
595
67.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
67.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
67.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
67.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
67.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
67.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
67.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
67.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
67.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
67.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
67.0k
    _memory_used_counter =
606
67.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
67.0k
    _common_profile->add_info_string("IsColocate",
608
67.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
67.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
67.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
67.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
67.0k
    return Status::OK();
613
67.0k
}
_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
209k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
209k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
209k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
209k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
209k
    _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
209k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
209k
    _operator_profile->add_child(_common_profile.get(), true);
557
209k
    _operator_profile->add_child(_custom_profile.get(), true);
558
209k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
209k
    if constexpr (!is_fake_shared) {
560
209k
        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
209k
        } 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
198k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
198k
            _dependency = _shared_state->create_source_dependency(
576
198k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
198k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
198k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
198k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
10.8k
        }
584
209k
    }
585
586
209k
    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
209k
    _rows_returned_counter =
591
209k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
209k
    _blocks_returned_counter =
593
209k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
209k
    _output_block_bytes_counter =
595
209k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
209k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
209k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
209k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
209k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
209k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
209k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
209k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
209k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
209k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
209k
    _memory_used_counter =
606
209k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
209k
    _common_profile->add_info_string("IsColocate",
608
209k
                                     std::to_string(_parent->is_colocated_operator()));
609
209k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
209k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
209k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
209k
    return Status::OK();
613
209k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_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_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.19k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.19k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.19k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.19k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.19k
    _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
6.19k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.19k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.19k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.19k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.19k
    if constexpr (!is_fake_shared) {
560
6.19k
        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
6.19k
        } 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.10k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.10k
            _dependency = _shared_state->create_source_dependency(
576
6.10k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.10k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.10k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.10k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
93
        }
584
6.19k
    }
585
586
6.19k
    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
6.19k
    _rows_returned_counter =
591
6.19k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.19k
    _blocks_returned_counter =
593
6.19k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.19k
    _output_block_bytes_counter =
595
6.19k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.19k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.19k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.19k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.19k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.19k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.19k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.19k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.19k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.19k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.19k
    _memory_used_counter =
606
6.19k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.19k
    _common_profile->add_info_string("IsColocate",
608
6.19k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.19k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.19k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.19k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.19k
    return Status::OK();
613
6.19k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.33k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.33k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.33k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.33k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.33k
    _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
8.33k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.33k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.33k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.33k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.33k
    if constexpr (!is_fake_shared) {
560
8.33k
        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
8.33k
        } 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
8.13k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.13k
            _dependency = _shared_state->create_source_dependency(
576
8.13k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.13k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.13k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.13k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
197
        }
584
8.33k
    }
585
586
8.33k
    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
8.33k
    _rows_returned_counter =
591
8.33k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.33k
    _blocks_returned_counter =
593
8.33k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.33k
    _output_block_bytes_counter =
595
8.33k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.33k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.33k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.33k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.33k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.33k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.33k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.33k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.33k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.33k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.33k
    _memory_used_counter =
606
8.33k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.33k
    _common_profile->add_info_string("IsColocate",
608
8.33k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.33k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.33k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.33k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.33k
    return Status::OK();
613
8.33k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
96.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
96.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
96.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
96.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
96.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
96.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
96.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
96.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
96.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
96.5k
    if constexpr (!is_fake_shared) {
560
96.5k
        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
96.5k
        } 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
94.3k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
94.3k
            _dependency = _shared_state->create_source_dependency(
576
94.3k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
94.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
94.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
94.3k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
2.19k
        }
584
96.5k
    }
585
586
96.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
96.5k
    _rows_returned_counter =
591
96.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
96.5k
    _blocks_returned_counter =
593
96.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
96.5k
    _output_block_bytes_counter =
595
96.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
96.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
96.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
96.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
96.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
96.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
96.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
96.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
96.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
96.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
96.5k
    _memory_used_counter =
606
96.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
96.5k
    _common_profile->add_info_string("IsColocate",
608
96.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
96.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
96.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
96.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
96.5k
    return Status::OK();
613
96.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.0k
    _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
54.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.0k
    if constexpr (!is_fake_shared) {
560
54.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
54.0k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
54.0k
                                    .first.get()
563
54.0k
                                    ->template cast<SharedStateArg>();
564
565
54.0k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
54.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
54.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.0k
        } 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
68
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
68
        }
584
54.0k
    }
585
586
54.0k
    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
54.0k
    _rows_returned_counter =
591
54.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.0k
    _blocks_returned_counter =
593
54.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.0k
    _output_block_bytes_counter =
595
54.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.0k
    _memory_used_counter =
606
54.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.0k
    _common_profile->add_info_string("IsColocate",
608
54.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.0k
    return Status::OK();
613
54.0k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
193
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
193
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
193
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
193
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
193
    _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
193
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
193
    _operator_profile->add_child(_common_profile.get(), true);
557
193
    _operator_profile->add_child(_custom_profile.get(), true);
558
193
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
193
    if constexpr (!is_fake_shared) {
560
193
        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
193
        } 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
193
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
193
            _dependency = _shared_state->create_source_dependency(
576
193
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
193
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
193
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
193
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
193
    }
585
586
193
    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
193
    _rows_returned_counter =
591
193
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
193
    _blocks_returned_counter =
593
193
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
193
    _output_block_bytes_counter =
595
193
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
193
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
193
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
193
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
193
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
193
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
193
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
193
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
193
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
193
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
193
    _memory_used_counter =
606
193
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
193
    _common_profile->add_info_string("IsColocate",
608
193
                                     std::to_string(_parent->is_colocated_operator()));
609
193
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
193
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
193
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
193
    return Status::OK();
613
193
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
775k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
775k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
775k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
775k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
775k
    _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
775k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
775k
    _operator_profile->add_child(_common_profile.get(), true);
557
775k
    _operator_profile->add_child(_custom_profile.get(), true);
558
775k
    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
775k
    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
775k
    _rows_returned_counter =
591
775k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
775k
    _blocks_returned_counter =
593
775k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
775k
    _output_block_bytes_counter =
595
775k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
775k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
775k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
775k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
775k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
775k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
775k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
775k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
775k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
775k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
775k
    _memory_used_counter =
606
775k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
775k
    _common_profile->add_info_string("IsColocate",
608
775k
                                     std::to_string(_parent->is_colocated_operator()));
609
775k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
775k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
775k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
775k
    return Status::OK();
613
775k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.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
54.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.7k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.7k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.7k
    if constexpr (!is_fake_shared) {
560
54.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
54.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
3.88k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
3.88k
            _dependency = _shared_state->create_source_dependency(
576
3.88k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
3.88k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
3.88k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.8k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
50.8k
        }
584
54.7k
    }
585
586
54.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
54.7k
    _rows_returned_counter =
591
54.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.7k
    _blocks_returned_counter =
593
54.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.7k
    _output_block_bytes_counter =
595
54.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.7k
    _memory_used_counter =
606
54.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.7k
    _common_profile->add_info_string("IsColocate",
608
54.7k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.7k
    return Status::OK();
613
54.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
6.00k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.00k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.00k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.00k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.00k
    _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
6.00k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.00k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.00k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.00k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.00k
    if constexpr (!is_fake_shared) {
560
6.00k
        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
6.00k
        } 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.98k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.98k
            _dependency = _shared_state->create_source_dependency(
576
5.98k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.98k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.98k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.98k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
16
        }
584
6.00k
    }
585
586
6.00k
    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
6.00k
    _rows_returned_counter =
591
6.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.00k
    _blocks_returned_counter =
593
6.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.00k
    _output_block_bytes_counter =
595
6.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.00k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.00k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.00k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.00k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.00k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.00k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.00k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.00k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.00k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.00k
    _memory_used_counter =
606
6.00k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.00k
    _common_profile->add_info_string("IsColocate",
608
6.00k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.00k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.00k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.00k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.00k
    return Status::OK();
613
6.00k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
429
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
429
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
429
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
429
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
429
    _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
429
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
429
    _operator_profile->add_child(_common_profile.get(), true);
557
429
    _operator_profile->add_child(_custom_profile.get(), true);
558
429
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
429
    if constexpr (!is_fake_shared) {
560
429
        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
429
        } 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
427
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
427
            _dependency = _shared_state->create_source_dependency(
576
427
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
427
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
427
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
427
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
2
        }
584
429
    }
585
586
429
    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
429
    _rows_returned_counter =
591
429
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
429
    _blocks_returned_counter =
593
429
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
429
    _output_block_bytes_counter =
595
429
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
429
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
429
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
429
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
429
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
429
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
429
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
429
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
429
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
429
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
429
    _memory_used_counter =
606
429
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
429
    _common_profile->add_info_string("IsColocate",
608
429
                                     std::to_string(_parent->is_colocated_operator()));
609
429
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
429
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
429
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
429
    return Status::OK();
613
429
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.08k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.08k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.08k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.08k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.08k
    _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.08k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.08k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.08k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.08k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.08k
    if constexpr (!is_fake_shared) {
560
5.08k
        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.08k
        } 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.79k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.79k
            _dependency = _shared_state->create_source_dependency(
576
4.79k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.79k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.79k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.79k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
287
        }
584
5.08k
    }
585
586
5.08k
    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.08k
    _rows_returned_counter =
591
5.08k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.08k
    _blocks_returned_counter =
593
5.08k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.08k
    _output_block_bytes_counter =
595
5.08k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.08k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.08k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.08k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.08k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.08k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.08k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.08k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.08k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.08k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.08k
    _memory_used_counter =
606
5.08k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.08k
    _common_profile->add_info_string("IsColocate",
608
5.08k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.08k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.08k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.08k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.08k
    return Status::OK();
613
5.08k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
576k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
576k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
576k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
576k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
576k
    _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
576k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
576k
    _operator_profile->add_child(_common_profile.get(), true);
557
576k
    _operator_profile->add_child(_custom_profile.get(), true);
558
576k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
576k
    if constexpr (!is_fake_shared) {
560
576k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
566k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
566k
                                    .first.get()
563
566k
                                    ->template cast<SharedStateArg>();
564
565
566k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
566k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
566k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
566k
        } 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
10.7k
        } else {
580
10.7k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
10.7k
                DCHECK(false);
582
10.7k
            }
583
10.7k
        }
584
576k
    }
585
586
576k
    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
576k
    _rows_returned_counter =
591
576k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
576k
    _blocks_returned_counter =
593
576k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
576k
    _output_block_bytes_counter =
595
576k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
576k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
576k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
576k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
576k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
576k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
576k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
576k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
576k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
576k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
576k
    _memory_used_counter =
606
576k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
576k
    _common_profile->add_info_string("IsColocate",
608
576k
                                     std::to_string(_parent->is_colocated_operator()));
609
576k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
576k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
576k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
576k
    return Status::OK();
613
576k
}
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
1.87M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.87M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.17M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
300k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
300k
    }
621
1.87M
    if (_parent->has_projection()) {
622
378k
        const auto& projection = *_parent->_projection;
623
378k
        _projections.resize(projection.projections.size());
624
2.33M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.95M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.95M
        }
627
378k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
394k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
15.9k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
220k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
204k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
204k
                        state, _intermediate_projections[i][j]));
633
204k
            }
634
15.9k
        }
635
378k
    }
636
1.87M
    return Status::OK();
637
1.87M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
67.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
67.2k
    _conjuncts.resize(_parent->_conjuncts.size());
618
68.5k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.35k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.35k
    }
621
67.2k
    if (_parent->has_projection()) {
622
67.2k
        const auto& projection = *_parent->_projection;
623
67.2k
        _projections.resize(projection.projections.size());
624
351k
        for (size_t i = 0; i < _projections.size(); i++) {
625
284k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
284k
        }
627
67.2k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
74.3k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.10k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
164k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
157k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
157k
                        state, _intermediate_projections[i][j]));
633
157k
            }
634
7.10k
        }
635
67.2k
    }
636
67.2k
    return Status::OK();
637
67.2k
}
_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
211k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
211k
    _conjuncts.resize(_parent->_conjuncts.size());
618
211k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
211k
    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
211k
    return Status::OK();
637
211k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
26
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
26
    _conjuncts.resize(_parent->_conjuncts.size());
618
26
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
26
    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
26
    return Status::OK();
637
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.20k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.20k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.32k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
122
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
122
    }
621
6.20k
    if (_parent->has_projection()) {
622
6.20k
        const auto& projection = *_parent->_projection;
623
6.20k
        _projections.resize(projection.projections.size());
624
27.3k
        for (size_t i = 0; i < _projections.size(); i++) {
625
21.1k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
21.1k
        }
627
6.20k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.26k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
57
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
381
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
324
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
324
                        state, _intermediate_projections[i][j]));
633
324
            }
634
57
        }
635
6.20k
    }
636
6.20k
    return Status::OK();
637
6.20k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.37k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.37k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.08k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
711
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
711
    }
621
8.37k
    if (_parent->has_projection()) {
622
4.48k
        const auto& projection = *_parent->_projection;
623
4.48k
        _projections.resize(projection.projections.size());
624
17.6k
        for (size_t i = 0; i < _projections.size(); i++) {
625
13.1k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
13.1k
        }
627
4.48k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.57k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
89
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
658
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
569
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
569
                        state, _intermediate_projections[i][j]));
633
569
            }
634
89
        }
635
4.48k
    }
636
8.37k
    return Status::OK();
637
8.37k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
97.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
97.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
98.5k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.51k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.51k
    }
621
97.0k
    if (_parent->has_projection()) {
622
31.9k
        const auto& projection = *_parent->_projection;
623
31.9k
        _projections.resize(projection.projections.size());
624
280k
        for (size_t i = 0; i < _projections.size(); i++) {
625
248k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
248k
        }
627
31.9k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
32.1k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
217
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.34k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
1.12k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
1.12k
                        state, _intermediate_projections[i][j]));
633
1.12k
            }
634
217
        }
635
31.9k
    }
636
97.0k
    return Status::OK();
637
97.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.1k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.1k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
27
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
27
    }
621
54.1k
    if (_parent->has_projection()) {
622
158
        const auto& projection = *_parent->_projection;
623
158
        _projections.resize(projection.projections.size());
624
554
        for (size_t i = 0; i < _projections.size(); i++) {
625
396
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
396
        }
627
158
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
160
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
2
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
9
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
9
                        state, _intermediate_projections[i][j]));
633
9
            }
634
2
        }
635
158
    }
636
54.1k
    return Status::OK();
637
54.1k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
197
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
197
    _conjuncts.resize(_parent->_conjuncts.size());
618
197
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
197
    if (_parent->has_projection()) {
622
178
        const auto& projection = *_parent->_projection;
623
178
        _projections.resize(projection.projections.size());
624
534
        for (size_t i = 0; i < _projections.size(); i++) {
625
356
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
356
        }
627
178
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
178
        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
178
    }
636
197
    return Status::OK();
637
197
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
779k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
779k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.07M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
296k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
296k
    }
621
779k
    if (_parent->has_projection()) {
622
256k
        const auto& projection = *_parent->_projection;
623
256k
        _projections.resize(projection.projections.size());
624
1.54M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.28M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.28M
        }
627
256k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
264k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
8.32k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
50.5k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
42.2k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
42.2k
                        state, _intermediate_projections[i][j]));
633
42.2k
            }
634
8.32k
        }
635
256k
    }
636
779k
    return Status::OK();
637
779k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.9k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
54.9k
    if (_parent->has_projection()) {
622
11.3k
        const auto& projection = *_parent->_projection;
623
11.3k
        _projections.resize(projection.projections.size());
624
110k
        for (size_t i = 0; i < _projections.size(); i++) {
625
98.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
98.8k
        }
627
11.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
148
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
2.72k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
2.57k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
2.57k
                        state, _intermediate_projections[i][j]));
633
2.57k
            }
634
148
        }
635
11.3k
    }
636
54.9k
    return Status::OK();
637
54.9k
}
_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.99k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.99k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.70k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
717
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
717
    }
621
5.99k
    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.99k
    return Status::OK();
637
5.99k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
432
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
432
    _conjuncts.resize(_parent->_conjuncts.size());
618
432
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
432
    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
432
    return Status::OK();
637
432
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.12k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.12k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.12k
    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.12k
    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.12k
    return Status::OK();
637
5.12k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
581k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
581k
    _conjuncts.resize(_parent->_conjuncts.size());
618
581k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
581k
    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
581k
    return Status::OK();
637
581k
}
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
7.56k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.56k
    if (_terminated) {
642
2
        return Status::OK();
643
2
    }
644
7.55k
    _terminated = true;
645
7.55k
    return Status::OK();
646
7.56k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
308
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
308
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
308
    _terminated = true;
645
308
    return Status::OK();
646
308
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
24
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
24
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
24
    _terminated = true;
645
24
    return Status::OK();
646
24
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
28
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
28
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
28
    _terminated = true;
645
28
    return Status::OK();
646
28
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
10
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
10
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
10
    _terminated = true;
645
10
    return Status::OK();
646
10
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
5.69k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5.69k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
5.69k
    _terminated = true;
645
5.69k
    return Status::OK();
646
5.69k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
27
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
27
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
27
    _terminated = true;
645
27
    return Status::OK();
646
27
}
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
432
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
432
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
432
    _terminated = true;
645
432
    return Status::OK();
646
432
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.00k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.00k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
1.00k
    _terminated = true;
645
1.00k
    return Status::OK();
646
1.00k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_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
}
647
648
template <typename SharedStateArg>
649
2.11M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.11M
    if (_closed) {
651
240k
        return Status::OK();
652
240k
    }
653
1.87M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.09M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.09M
    }
656
1.87M
    _closed = true;
657
1.87M
    return Status::OK();
658
2.11M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
67.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
67.1k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
67.1k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
67.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
67.1k
    }
656
67.1k
    _closed = true;
657
67.1k
    return Status::OK();
658
67.1k
}
_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
418k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
418k
    if (_closed) {
651
210k
        return Status::OK();
652
210k
    }
653
207k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
207k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
207k
    }
656
207k
    _closed = true;
657
207k
    return Status::OK();
658
418k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
26
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
26
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
26
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
26
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
26
    }
656
26
    _closed = true;
657
26
    return Status::OK();
658
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.20k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.20k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.20k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.20k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.20k
    }
656
6.20k
    _closed = true;
657
6.20k
    return Status::OK();
658
6.20k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
16.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
16.8k
    if (_closed) {
651
8.50k
        return Status::OK();
652
8.50k
    }
653
8.33k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.33k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.33k
    }
656
8.33k
    _closed = true;
657
8.33k
    return Status::OK();
658
16.8k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
96.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
96.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
96.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
96.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
96.6k
    }
656
96.6k
    _closed = true;
657
96.6k
    return Status::OK();
658
96.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
53.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
53.8k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
53.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
53.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
53.8k
    }
656
53.8k
    _closed = true;
657
53.8k
    return Status::OK();
658
53.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
192
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
192
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
192
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
192
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
192
    }
656
192
    _closed = true;
657
192
    return Status::OK();
658
192
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
796k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
796k
    if (_closed) {
651
15.5k
        return Status::OK();
652
15.5k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
780k
    _closed = true;
657
780k
    return Status::OK();
658
796k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.9k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.9k
    }
656
54.9k
    _closed = true;
657
54.9k
    return Status::OK();
658
54.9k
}
_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.95k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.95k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.95k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.95k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.95k
    }
656
5.95k
    _closed = true;
657
5.95k
    return Status::OK();
658
5.95k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
660
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
660
    if (_closed) {
651
330
        return Status::OK();
652
330
    }
653
330
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
330
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
330
    }
656
330
    _closed = true;
657
330
    return Status::OK();
658
660
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.3k
    if (_closed) {
651
5.25k
        return Status::OK();
652
5.25k
    }
653
5.11k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.11k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.11k
    }
656
5.11k
    _closed = true;
657
5.11k
    return Status::OK();
658
10.3k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
583k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
583k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
583k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
583k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
583k
    }
656
583k
    _closed = true;
657
583k
    return Status::OK();
658
583k
}
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.59M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.59M
    _operator_profile =
664
1.59M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.59M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.59M
    _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.59M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.59M
    _operator_profile->add_child(_common_profile, true);
673
1.59M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.59M
    _operator_profile->set_metadata(_parent->node_id());
676
1.59M
    _wait_for_finish_dependency_timer =
677
1.59M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.59M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.59M
    if constexpr (!is_fake_shared) {
680
1.12M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.12M
            info.shared_state_map.end()) {
682
291k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
224k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
224k
            }
685
291k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
291k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
291k
                                                  ? 0
688
291k
                                                  : info.task_idx]
689
291k
                                  .get();
690
291k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
828k
        } else {
692
828k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
75
                DCHECK(false);
694
75
            }
695
828k
            _shared_state = info.shared_state->template cast<SharedState>();
696
828k
            _dependency = _shared_state->create_sink_dependency(
697
828k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
828k
        }
699
1.12M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.12M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.12M
    }
702
703
1.59M
    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.59M
    _rows_input_counter =
708
1.59M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.59M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.59M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.59M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.59M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.59M
    _memory_used_counter =
714
1.59M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.59M
    _common_profile->add_info_string("IsColocate",
716
1.59M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.59M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.59M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.59M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.59M
    return Status::OK();
721
1.59M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
115k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
115k
    _operator_profile =
664
115k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
115k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
115k
    _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
115k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
115k
    _operator_profile->add_child(_common_profile, true);
673
115k
    _operator_profile->add_child(_custom_profile, true);
674
675
115k
    _operator_profile->set_metadata(_parent->node_id());
676
115k
    _wait_for_finish_dependency_timer =
677
115k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
115k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
115k
    if constexpr (!is_fake_shared) {
680
115k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
115k
            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
12.6k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
12.6k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
12.6k
                                                  ? 0
688
12.6k
                                                  : info.task_idx]
689
12.6k
                                  .get();
690
12.6k
            _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
115k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
115k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
115k
    }
702
703
115k
    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
115k
    _rows_input_counter =
708
115k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
115k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
115k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
115k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
115k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
115k
    _memory_used_counter =
714
115k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
115k
    _common_profile->add_info_string("IsColocate",
716
115k
                                     std::to_string(_parent->is_colocated_operator()));
717
115k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
115k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
115k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
115k
    return Status::OK();
721
115k
}
_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
210k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
210k
    _operator_profile =
664
210k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
210k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
210k
    _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
210k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
210k
    _operator_profile->add_child(_common_profile, true);
673
210k
    _operator_profile->add_child(_custom_profile, true);
674
675
210k
    _operator_profile->set_metadata(_parent->node_id());
676
210k
    _wait_for_finish_dependency_timer =
677
210k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
210k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
210k
    if constexpr (!is_fake_shared) {
680
210k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
210k
            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
210k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
210k
            _shared_state = info.shared_state->template cast<SharedState>();
696
210k
            _dependency = _shared_state->create_sink_dependency(
697
210k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
210k
        }
699
210k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
210k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
210k
    }
702
703
210k
    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
210k
    _rows_input_counter =
708
210k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
210k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
210k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
210k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
210k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
210k
    _memory_used_counter =
714
210k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
210k
    _common_profile->add_info_string("IsColocate",
716
210k
                                     std::to_string(_parent->is_colocated_operator()));
717
210k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
210k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
210k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
210k
    return Status::OK();
721
210k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
33
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
33
    _operator_profile =
664
33
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
33
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
33
    _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
33
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
33
    _operator_profile->add_child(_common_profile, true);
673
33
    _operator_profile->add_child(_custom_profile, true);
674
675
33
    _operator_profile->set_metadata(_parent->node_id());
676
33
    _wait_for_finish_dependency_timer =
677
33
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
33
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
33
    if constexpr (!is_fake_shared) {
680
33
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
33
            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
33
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
33
            _shared_state = info.shared_state->template cast<SharedState>();
696
33
            _dependency = _shared_state->create_sink_dependency(
697
33
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
33
        }
699
33
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
33
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
33
    }
702
703
33
    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
33
    _rows_input_counter =
708
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
33
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
33
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
33
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
33
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
33
    _memory_used_counter =
714
33
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
33
    _common_profile->add_info_string("IsColocate",
716
33
                                     std::to_string(_parent->is_colocated_operator()));
717
33
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
33
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
33
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
33
    return Status::OK();
721
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.19k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.19k
    _operator_profile =
664
6.19k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.19k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.19k
    _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
6.19k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.19k
    _operator_profile->add_child(_common_profile, true);
673
6.19k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.19k
    _operator_profile->set_metadata(_parent->node_id());
676
6.19k
    _wait_for_finish_dependency_timer =
677
6.19k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.19k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.19k
    if constexpr (!is_fake_shared) {
680
6.19k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.19k
            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
6.19k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.19k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.19k
            _dependency = _shared_state->create_sink_dependency(
697
6.19k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.19k
        }
699
6.19k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.19k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.19k
    }
702
703
6.19k
    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
6.19k
    _rows_input_counter =
708
6.19k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.19k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.19k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.19k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.19k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.19k
    _memory_used_counter =
714
6.19k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.19k
    _common_profile->add_info_string("IsColocate",
716
6.19k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.19k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.19k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.19k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.19k
    return Status::OK();
721
6.19k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.34k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.34k
    _operator_profile =
664
8.34k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.34k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.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
8.34k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.34k
    _operator_profile->add_child(_common_profile, true);
673
8.34k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.34k
    _operator_profile->set_metadata(_parent->node_id());
676
8.34k
    _wait_for_finish_dependency_timer =
677
8.34k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.34k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.34k
    if constexpr (!is_fake_shared) {
680
8.34k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.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
8.34k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.34k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.34k
            _dependency = _shared_state->create_sink_dependency(
697
8.34k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.34k
        }
699
8.34k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.34k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.34k
    }
702
703
8.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
8.34k
    _rows_input_counter =
708
8.34k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.34k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.34k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.34k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.34k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.34k
    _memory_used_counter =
714
8.34k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.34k
    _common_profile->add_info_string("IsColocate",
716
8.34k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.34k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.34k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.34k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.34k
    return Status::OK();
721
8.34k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
96.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
96.8k
    _operator_profile =
664
96.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
96.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
96.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
96.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
96.8k
    _operator_profile->add_child(_common_profile, true);
673
96.8k
    _operator_profile->add_child(_custom_profile, true);
674
675
96.8k
    _operator_profile->set_metadata(_parent->node_id());
676
96.8k
    _wait_for_finish_dependency_timer =
677
96.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
96.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
96.8k
    if constexpr (!is_fake_shared) {
680
96.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
96.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
96.8k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
96.8k
            _shared_state = info.shared_state->template cast<SharedState>();
696
96.8k
            _dependency = _shared_state->create_sink_dependency(
697
96.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
96.8k
        }
699
96.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
96.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
96.8k
    }
702
703
96.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
96.8k
    _rows_input_counter =
708
96.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
96.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
96.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
96.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
96.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
96.8k
    _memory_used_counter =
714
96.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
96.8k
    _common_profile->add_info_string("IsColocate",
716
96.8k
                                     std::to_string(_parent->is_colocated_operator()));
717
96.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
96.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
96.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
96.8k
    return Status::OK();
721
96.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
54.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
54.0k
    _operator_profile =
664
54.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
54.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
54.0k
    _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
54.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
54.0k
    _operator_profile->add_child(_common_profile, true);
673
54.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
54.0k
    _operator_profile->set_metadata(_parent->node_id());
676
54.0k
    _wait_for_finish_dependency_timer =
677
54.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
54.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
54.0k
    if constexpr (!is_fake_shared) {
680
54.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
54.0k
            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
54.0k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
54.0k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
54.0k
                                                  ? 0
688
54.0k
                                                  : info.task_idx]
689
54.0k
                                  .get();
690
54.0k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
54.0k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
20
            _shared_state = info.shared_state->template cast<SharedState>();
696
20
            _dependency = _shared_state->create_sink_dependency(
697
20
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
20
        }
699
54.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
54.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
54.0k
    }
702
703
54.0k
    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
54.0k
    _rows_input_counter =
708
54.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
54.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
54.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
54.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
54.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
54.0k
    _memory_used_counter =
714
54.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
54.0k
    _common_profile->add_info_string("IsColocate",
716
54.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
54.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
54.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
54.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
54.0k
    return Status::OK();
721
54.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
203
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
203
    _operator_profile =
664
203
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
203
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
203
    _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
203
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
203
    _operator_profile->add_child(_common_profile, true);
673
203
    _operator_profile->add_child(_custom_profile, true);
674
675
203
    _operator_profile->set_metadata(_parent->node_id());
676
203
    _wait_for_finish_dependency_timer =
677
203
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
203
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
203
    if constexpr (!is_fake_shared) {
680
203
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
203
            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
203
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
203
            _shared_state = info.shared_state->template cast<SharedState>();
696
203
            _dependency = _shared_state->create_sink_dependency(
697
203
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
203
        }
699
203
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
203
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
203
    }
702
703
203
    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
203
    _rows_input_counter =
708
203
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
203
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
203
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
203
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
203
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
203
    _memory_used_counter =
714
203
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
203
    _common_profile->add_info_string("IsColocate",
716
203
                                     std::to_string(_parent->is_colocated_operator()));
717
203
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
203
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
203
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
203
    return Status::OK();
721
203
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
472k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
472k
    _operator_profile =
664
472k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
472k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
472k
    _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
472k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
472k
    _operator_profile->add_child(_common_profile, true);
673
472k
    _operator_profile->add_child(_custom_profile, true);
674
675
472k
    _operator_profile->set_metadata(_parent->node_id());
676
472k
    _wait_for_finish_dependency_timer =
677
472k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
472k
    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
472k
    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
472k
    _rows_input_counter =
708
472k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
472k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
472k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
472k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
472k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
472k
    _memory_used_counter =
714
472k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
472k
    _common_profile->add_info_string("IsColocate",
716
472k
                                     std::to_string(_parent->is_colocated_operator()));
717
472k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
472k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
472k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
472k
    return Status::OK();
721
472k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.98k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.98k
    _operator_profile =
664
8.98k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.98k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.98k
    _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
8.98k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.98k
    _operator_profile->add_child(_common_profile, true);
673
8.98k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.98k
    _operator_profile->set_metadata(_parent->node_id());
676
8.98k
    _wait_for_finish_dependency_timer =
677
8.98k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.98k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.98k
    if constexpr (!is_fake_shared) {
680
8.98k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.98k
            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
8.98k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.98k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.98k
            _dependency = _shared_state->create_sink_dependency(
697
8.98k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.98k
        }
699
8.98k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.98k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.98k
    }
702
703
8.98k
    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
8.98k
    _rows_input_counter =
708
8.98k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.98k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.98k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.98k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.98k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.98k
    _memory_used_counter =
714
8.98k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.98k
    _common_profile->add_info_string("IsColocate",
716
8.98k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.98k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.98k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.98k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.98k
    return Status::OK();
721
8.98k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
430
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
430
    _operator_profile =
664
430
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
430
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
430
    _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
430
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
430
    _operator_profile->add_child(_common_profile, true);
673
430
    _operator_profile->add_child(_custom_profile, true);
674
675
430
    _operator_profile->set_metadata(_parent->node_id());
676
430
    _wait_for_finish_dependency_timer =
677
430
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
430
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
430
    if constexpr (!is_fake_shared) {
680
430
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
430
            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
430
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
430
            _shared_state = info.shared_state->template cast<SharedState>();
696
430
            _dependency = _shared_state->create_sink_dependency(
697
430
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
430
        }
699
430
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
430
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
430
    }
702
703
430
    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
430
    _rows_input_counter =
708
430
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
430
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
430
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
430
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
430
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
430
    _memory_used_counter =
714
430
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
430
    _common_profile->add_info_string("IsColocate",
716
430
                                     std::to_string(_parent->is_colocated_operator()));
717
430
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
430
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
430
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
430
    return Status::OK();
721
430
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.46k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.46k
    _operator_profile =
664
2.46k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.46k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.46k
    _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.46k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.46k
    _operator_profile->add_child(_common_profile, true);
673
2.46k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.46k
    _operator_profile->set_metadata(_parent->node_id());
676
2.46k
    _wait_for_finish_dependency_timer =
677
2.46k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.46k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.46k
    if constexpr (!is_fake_shared) {
680
2.46k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.46k
            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.46k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.46k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.46k
            _dependency = _shared_state->create_sink_dependency(
697
2.46k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.46k
        }
699
2.46k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.46k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.46k
    }
702
703
2.46k
    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.46k
    _rows_input_counter =
708
2.46k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.46k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.46k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.46k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.46k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.46k
    _memory_used_counter =
714
2.46k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.46k
    _common_profile->add_info_string("IsColocate",
716
2.46k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.46k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.46k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.46k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.46k
    return Status::OK();
721
2.46k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.4k
    _operator_profile =
664
12.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.4k
    _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.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.4k
    _operator_profile->add_child(_common_profile, true);
673
12.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.4k
    _operator_profile->set_metadata(_parent->node_id());
676
12.4k
    _wait_for_finish_dependency_timer =
677
12.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.4k
    if constexpr (!is_fake_shared) {
680
12.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.4k
            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.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.4k
            _dependency = _shared_state->create_sink_dependency(
697
12.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.4k
        }
699
12.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.4k
    }
702
703
12.4k
    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.4k
    _rows_input_counter =
708
12.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.4k
    _memory_used_counter =
714
12.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.4k
    _common_profile->add_info_string("IsColocate",
716
12.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.4k
    return Status::OK();
721
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
224k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
224k
    _operator_profile =
664
224k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
224k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
224k
    _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
224k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
224k
    _operator_profile->add_child(_common_profile, true);
673
224k
    _operator_profile->add_child(_custom_profile, true);
674
675
224k
    _operator_profile->set_metadata(_parent->node_id());
676
224k
    _wait_for_finish_dependency_timer =
677
224k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
224k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
224k
    if constexpr (!is_fake_shared) {
680
224k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
224k
            info.shared_state_map.end()) {
682
224k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
224k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
224k
            }
685
224k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
224k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
224k
                                                  ? 0
688
224k
                                                  : info.task_idx]
689
224k
                                  .get();
690
224k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
224k
        } else {
692
75
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
75
                DCHECK(false);
694
75
            }
695
75
            _shared_state = info.shared_state->template cast<SharedState>();
696
75
            _dependency = _shared_state->create_sink_dependency(
697
75
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
75
        }
699
224k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
224k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
224k
    }
702
703
224k
    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
224k
    _rows_input_counter =
708
224k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
224k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
224k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
224k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
224k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
224k
    _memory_used_counter =
714
224k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
224k
    _common_profile->add_info_string("IsColocate",
716
224k
                                     std::to_string(_parent->is_colocated_operator()));
717
224k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
224k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
224k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
224k
    return Status::OK();
721
224k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
379k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
379k
    _operator_profile =
664
379k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
379k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
379k
    _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
379k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
379k
    _operator_profile->add_child(_common_profile, true);
673
379k
    _operator_profile->add_child(_custom_profile, true);
674
675
379k
    _operator_profile->set_metadata(_parent->node_id());
676
379k
    _wait_for_finish_dependency_timer =
677
379k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
379k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
379k
    if constexpr (!is_fake_shared) {
680
379k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
379k
            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
379k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
379k
            _shared_state = info.shared_state->template cast<SharedState>();
696
379k
            _dependency = _shared_state->create_sink_dependency(
697
379k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
379k
        }
699
379k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
379k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
379k
    }
702
703
379k
    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
379k
    _rows_input_counter =
708
379k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
379k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
379k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
379k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
379k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
379k
    _memory_used_counter =
714
379k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
379k
    _common_profile->add_info_string("IsColocate",
716
379k
                                     std::to_string(_parent->is_colocated_operator()));
717
379k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
379k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
379k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
379k
    return Status::OK();
721
379k
}
_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.59M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.59M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.59M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.12M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.12M
    }
731
1.59M
    _closed = true;
732
1.59M
    return Status::OK();
733
1.59M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
115k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
115k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
115k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
115k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
115k
    }
731
115k
    _closed = true;
732
115k
    return Status::OK();
733
115k
}
_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
210k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
210k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
210k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
210k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
210k
    }
731
210k
    _closed = true;
732
210k
    return Status::OK();
733
210k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
24
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
24
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
22
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
22
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
22
    }
731
22
    _closed = true;
732
22
    return Status::OK();
733
24
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.17k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.17k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.17k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.17k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.17k
    }
731
6.17k
    _closed = true;
732
6.17k
    return Status::OK();
733
6.17k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.31k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.31k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.31k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.31k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.31k
    }
731
8.31k
    _closed = true;
732
8.31k
    return Status::OK();
733
8.31k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
96.5k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
96.5k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
96.5k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
96.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
96.5k
    }
731
96.5k
    _closed = true;
732
96.5k
    return Status::OK();
733
96.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
53.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
53.7k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
53.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
53.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
53.7k
    }
731
53.7k
    _closed = true;
732
53.7k
    return Status::OK();
733
53.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
192
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
192
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
192
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
192
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
192
    }
731
192
    _closed = true;
732
192
    return Status::OK();
733
192
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
477k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
477k
    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
477k
    _closed = true;
732
477k
    return Status::OK();
733
477k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.98k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.98k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.98k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.98k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.98k
    }
731
8.98k
    _closed = true;
732
8.98k
    return Status::OK();
733
8.98k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
329
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
329
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
329
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
329
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
329
    }
731
329
    _closed = true;
732
329
    return Status::OK();
733
329
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.47k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.47k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.47k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.47k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.47k
    }
731
2.47k
    _closed = true;
732
2.47k
    return Status::OK();
733
2.47k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.4k
    }
731
12.4k
    _closed = true;
732
12.4k
    return Status::OK();
733
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
225k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
225k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
225k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
225k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
225k
    }
731
225k
    _closed = true;
732
225k
    return Status::OK();
733
225k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
381k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
381k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
381k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
381k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
381k
    }
731
381k
    _closed = true;
732
381k
    return Status::OK();
733
381k
}
_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.72k
                                                          bool* eos) {
738
7.72k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.71k
    return pull(state, block, eos);
740
7.72k
}
_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.68k
                                                          bool* eos) {
738
7.68k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.67k
    return pull(state, block, eos);
740
7.68k
}
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
467k
        local_state._child_block->clear_column_data(
748
467k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
467k
                        .num_materialized_slots());
750
467k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
467k
                state, local_state._child_block.get(), &local_state._child_eos));
752
467k
        *eos = local_state._child_eos;
753
467k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
80.2k
            return Status::OK();
755
80.2k
        }
756
387k
        {
757
387k
            SCOPED_TIMER(local_state.exec_time_counter());
758
387k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
387k
        }
760
387k
    }
761
762
417k
    if (!need_more_input_data(state)) {
763
389k
        SCOPED_TIMER(local_state.exec_time_counter());
764
389k
        bool new_eos = false;
765
389k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
389k
        if (new_eos) {
767
314k
            *eos = true;
768
314k
        } else if (!need_more_input_data(state)) {
769
23.3k
            *eos = false;
770
23.3k
        }
771
389k
    }
772
417k
    return Status::OK();
773
417k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
135k
                                                         bool* eos) {
745
135k
    auto& local_state = get_local_state(state);
746
135k
    if (need_more_input_data(state)) {
747
117k
        local_state._child_block->clear_column_data(
748
117k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
117k
                        .num_materialized_slots());
750
117k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
117k
                state, local_state._child_block.get(), &local_state._child_eos));
752
117k
        *eos = local_state._child_eos;
753
117k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
37.0k
            return Status::OK();
755
37.0k
        }
756
80.0k
        {
757
80.0k
            SCOPED_TIMER(local_state.exec_time_counter());
758
80.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
80.0k
        }
760
80.0k
    }
761
762
98.3k
    if (!need_more_input_data(state)) {
763
98.3k
        SCOPED_TIMER(local_state.exec_time_counter());
764
98.3k
        bool new_eos = false;
765
98.3k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
98.3k
        if (new_eos) {
767
42.8k
            *eos = true;
768
55.4k
        } else if (!need_more_input_data(state)) {
769
10.7k
            *eos = false;
770
10.7k
        }
771
98.3k
    }
772
98.2k
    return Status::OK();
773
98.2k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.40k
                                                         bool* eos) {
745
4.40k
    auto& local_state = get_local_state(state);
746
4.40k
    if (need_more_input_data(state)) {
747
2.46k
        local_state._child_block->clear_column_data(
748
2.46k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.46k
                        .num_materialized_slots());
750
2.46k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.46k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.46k
        *eos = local_state._child_eos;
753
2.46k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
500
            return Status::OK();
755
500
        }
756
1.96k
        {
757
1.96k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.96k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.96k
        }
760
1.96k
    }
761
762
3.93k
    if (!need_more_input_data(state)) {
763
3.93k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.93k
        bool new_eos = false;
765
3.93k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.93k
        if (new_eos) {
767
1.33k
            *eos = true;
768
2.60k
        } else if (!need_more_input_data(state)) {
769
1.94k
            *eos = false;
770
1.94k
        }
771
3.93k
    }
772
3.90k
    return Status::OK();
773
3.90k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.86k
                                                         bool* eos) {
745
1.86k
    auto& local_state = get_local_state(state);
746
1.86k
    if (need_more_input_data(state)) {
747
1.86k
        local_state._child_block->clear_column_data(
748
1.86k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.86k
                        .num_materialized_slots());
750
1.86k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.86k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.86k
        *eos = local_state._child_eos;
753
1.86k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
775
            return Status::OK();
755
775
        }
756
1.08k
        {
757
1.08k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.08k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.08k
        }
760
1.08k
    }
761
762
1.08k
    if (!need_more_input_data(state)) {
763
1.08k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.08k
        bool new_eos = false;
765
1.08k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.08k
        if (new_eos) {
767
795
            *eos = true;
768
795
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.08k
    }
772
1.08k
    return Status::OK();
773
1.08k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
16.5k
                                                         bool* eos) {
745
16.5k
    auto& local_state = get_local_state(state);
746
16.5k
    if (need_more_input_data(state)) {
747
16.5k
        local_state._child_block->clear_column_data(
748
16.5k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
16.5k
                        .num_materialized_slots());
750
16.5k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
16.5k
                state, local_state._child_block.get(), &local_state._child_eos));
752
16.5k
        *eos = local_state._child_eos;
753
16.5k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
3.53k
            return Status::OK();
755
3.53k
        }
756
12.9k
        {
757
12.9k
            SCOPED_TIMER(local_state.exec_time_counter());
758
12.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
12.9k
        }
760
12.9k
    }
761
762
12.9k
    if (!need_more_input_data(state)) {
763
7.10k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.10k
        bool new_eos = false;
765
7.10k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.10k
        if (new_eos) {
767
7.01k
            *eos = true;
768
7.01k
        } else if (!need_more_input_data(state)) {
769
6
            *eos = false;
770
6
        }
771
7.10k
    }
772
12.9k
    return Status::OK();
773
12.9k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
310k
                                                         bool* eos) {
745
310k
    auto& local_state = get_local_state(state);
746
311k
    if (need_more_input_data(state)) {
747
311k
        local_state._child_block->clear_column_data(
748
311k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
311k
                        .num_materialized_slots());
750
311k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
311k
                state, local_state._child_block.get(), &local_state._child_eos));
752
311k
        *eos = local_state._child_eos;
753
311k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
36.2k
            return Status::OK();
755
36.2k
        }
756
275k
        {
757
275k
            SCOPED_TIMER(local_state.exec_time_counter());
758
275k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
275k
        }
760
275k
    }
761
762
274k
    if (!need_more_input_data(state)) {
763
252k
        SCOPED_TIMER(local_state.exec_time_counter());
764
252k
        bool new_eos = false;
765
252k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
252k
        if (new_eos) {
767
252k
            *eos = true;
768
252k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
252k
    }
772
274k
    return Status::OK();
773
274k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
21.1k
                                                         bool* eos) {
745
21.1k
    auto& local_state = get_local_state(state);
746
21.1k
    if (need_more_input_data(state)) {
747
10.8k
        local_state._child_block->clear_column_data(
748
10.8k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.8k
                        .num_materialized_slots());
750
10.8k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.8k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.8k
        *eos = local_state._child_eos;
753
10.8k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
828
            return Status::OK();
755
828
        }
756
10.0k
        {
757
10.0k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.0k
        }
760
10.0k
    }
761
762
20.3k
    if (!need_more_input_data(state)) {
763
19.7k
        SCOPED_TIMER(local_state.exec_time_counter());
764
19.7k
        bool new_eos = false;
765
19.7k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
19.7k
        if (new_eos) {
767
6.14k
            *eos = true;
768
13.6k
        } else if (!need_more_input_data(state)) {
769
10.3k
            *eos = false;
770
10.3k
        }
771
19.7k
    }
772
20.3k
    return Status::OK();
773
20.3k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.62k
                                                         bool* eos) {
745
7.62k
    auto& local_state = get_local_state(state);
746
7.62k
    if (need_more_input_data(state)) {
747
7.27k
        local_state._child_block->clear_column_data(
748
7.27k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
7.27k
                        .num_materialized_slots());
750
7.27k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
7.27k
                state, local_state._child_block.get(), &local_state._child_eos));
752
7.27k
        *eos = local_state._child_eos;
753
7.27k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.26k
            return Status::OK();
755
1.26k
        }
756
6.00k
        {
757
6.00k
            SCOPED_TIMER(local_state.exec_time_counter());
758
6.00k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
6.00k
        }
760
6.00k
    }
761
762
6.35k
    if (!need_more_input_data(state)) {
763
6.35k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.35k
        bool new_eos = false;
765
6.35k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.35k
        if (new_eos) {
767
4.33k
            *eos = true;
768
4.33k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.35k
    }
772
6.35k
    return Status::OK();
773
6.35k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
45.9k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
45.9k
    RETURN_IF_ERROR(Base::init(state, info));
779
45.9k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
45.9k
                                                         "AsyncWriterDependency", true);
781
45.9k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
45.9k
                             _finish_dependency));
783
784
45.9k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
45.9k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
45.9k
    return Status::OK();
787
45.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
358
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
358
    RETURN_IF_ERROR(Base::init(state, info));
779
358
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
358
                                                         "AsyncWriterDependency", true);
781
358
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
358
                             _finish_dependency));
783
784
358
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
358
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
358
    return Status::OK();
787
358
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
45.5k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
45.5k
    RETURN_IF_ERROR(Base::init(state, info));
779
45.5k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
45.5k
                                                         "AsyncWriterDependency", true);
781
45.5k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
45.5k
                             _finish_dependency));
783
784
45.5k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
45.5k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
45.5k
    return Status::OK();
787
45.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
44
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
44
    RETURN_IF_ERROR(Base::init(state, info));
779
44
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
44
                                                         "AsyncWriterDependency", true);
781
44
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
44
                             _finish_dependency));
783
784
44
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
44
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
44
    return Status::OK();
787
44
}
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
46.6k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.6k
    RETURN_IF_ERROR(Base::open(state));
793
46.6k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
362k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
315k
        RETURN_IF_ERROR(
796
315k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
315k
    }
798
46.6k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.6k
    return Status::OK();
800
46.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
359
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
359
    RETURN_IF_ERROR(Base::open(state));
793
359
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.85k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.49k
        RETURN_IF_ERROR(
796
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.49k
    }
798
359
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
359
    return Status::OK();
800
359
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
46.2k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.2k
    RETURN_IF_ERROR(Base::open(state));
793
46.2k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
359k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
313k
        RETURN_IF_ERROR(
796
313k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
313k
    }
798
46.2k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.2k
    return Status::OK();
800
46.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
44
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
44
    RETURN_IF_ERROR(Base::open(state));
793
44
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
792
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
748
        RETURN_IF_ERROR(
796
748
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
748
    }
798
44
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
44
    return Status::OK();
800
44
}
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
61.9k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.9k
    return _writer->sink(block, eos);
806
61.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.53k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.53k
    return _writer->sink(block, eos);
806
1.53k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
60.3k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
60.3k
    return _writer->sink(block, eos);
806
60.3k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
44
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
44
    return _writer->sink(block, eos);
806
44
}
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
46.7k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
46.7k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
46.7k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
46.7k
    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.7k
    if (_writer) {
818
46.7k
        Status st = _writer->get_writer_status();
819
46.7k
        if (exec_status.ok()) {
820
46.6k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
46.6k
                                                       : Status::Cancelled("force close"));
822
46.6k
        } else {
823
119
            _writer->force_close(exec_status);
824
119
        }
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.7k
        RETURN_IF_ERROR(st);
829
46.7k
    }
830
46.6k
    return Base::close(state, exec_status);
831
46.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
347
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
347
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
347
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
347
    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
347
    if (_writer) {
818
347
        Status st = _writer->get_writer_status();
819
347
        if (exec_status.ok()) {
820
347
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
347
                                                       : Status::Cancelled("force close"));
822
347
        } 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
347
        RETURN_IF_ERROR(st);
829
347
    }
830
347
    return Base::close(state, exec_status);
831
347
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
46.3k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
46.3k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
46.3k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
46.3k
    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.3k
    if (_writer) {
818
46.3k
        Status st = _writer->get_writer_status();
819
46.3k
        if (exec_status.ok()) {
820
46.2k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
46.2k
                                                       : Status::Cancelled("force close"));
822
46.2k
        } else {
823
119
            _writer->force_close(exec_status);
824
119
        }
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.3k
        RETURN_IF_ERROR(st);
829
46.3k
    }
830
46.3k
    return Base::close(state, exec_status);
831
46.3k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
44
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
44
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
44
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
44
    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
44
    if (_writer) {
818
44
        Status st = _writer->get_writer_status();
819
44
        if (exec_status.ok()) {
820
44
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
44
                                                       : Status::Cancelled("force close"));
822
44
        } 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
44
        RETURN_IF_ERROR(st);
829
44
    }
830
44
    return Base::close(state, exec_status);
831
44
}
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