Coverage Report

Created: 2026-09-16 11:39

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.80M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.80M
    if (_parent->nereids_id() == -1) {
122
931k
        return fmt::format("(id={})", _parent->node_id());
123
931k
    } else {
124
872k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
872k
    }
126
1.80M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
68.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
68.8k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
68.8k
    } else {
124
68.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
68.8k
    }
126
68.8k
}
_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
208k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
208k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
208k
    } else {
124
208k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
208k
    }
126
208k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
34
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
34
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
34
    } else {
124
34
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
34
    }
126
34
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.73k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.73k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.73k
    } else {
124
5.73k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.73k
    }
126
5.73k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
7.20k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
7.20k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
7.19k
    } else {
124
7.19k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7.19k
    }
126
7.20k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
88.7k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
88.7k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
88.7k
    } else {
124
88.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
88.7k
    }
126
88.7k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
58.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
58.4k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
58.4k
    } else {
124
58.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
58.4k
    }
126
58.4k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
141
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
141
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
141
    } else {
124
141
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
141
    }
126
141
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
680k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
680k
    if (_parent->nereids_id() == -1) {
122
305k
        return fmt::format("(id={})", _parent->node_id());
123
375k
    } else {
124
375k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
375k
    }
126
680k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.4k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.4k
    } else {
124
54.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.4k
    }
126
54.4k
}
_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
4.87k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.87k
    if (_parent->nereids_id() == -1) {
122
4.87k
        return fmt::format("(id={})", _parent->node_id());
123
4.87k
    } else {
124
2
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
2
    }
126
4.87k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
391
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
391
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
289
    } else {
124
289
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
289
    }
126
391
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.01k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.01k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
4.99k
    } else {
124
4.99k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4.99k
    }
126
5.01k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
621k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
621k
    if (_parent->nereids_id() == -1) {
122
621k
        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
621k
}
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.16M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.16M
    if (_parent->nereids_id() == -1) {
131
663k
        return fmt::format("(id={})", _parent->node_id());
132
663k
    } else {
133
496k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
496k
    }
135
1.16M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
117k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
117k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
117k
    } else {
133
117k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
117k
    }
135
117k
}
_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
210k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
210k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
210k
    } else {
133
210k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
210k
    }
135
210k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
42
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
42
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
42
    } else {
133
42
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
42
    }
135
42
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.77k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.77k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.77k
    } else {
133
5.77k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.77k
    }
135
5.77k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.21k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.21k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
7.20k
    } else {
133
7.20k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.20k
    }
135
7.21k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
89.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
89.0k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
89.0k
    } else {
133
89.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
89.0k
    }
135
89.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
58.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
58.3k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
58.3k
    } else {
133
58.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
58.3k
    }
135
58.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
156
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
156
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
156
    } else {
133
156
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
156
    }
135
156
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
24
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
24
    if (_parent->nereids_id() == -1) {
131
24
        return fmt::format("(id={})", _parent->node_id());
132
24
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
24
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9.81k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9.81k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
9.80k
    } else {
133
9.80k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
9.80k
    }
135
9.81k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
395
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
395
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
293
    } else {
133
293
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
293
    }
135
395
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.5k
    if (_parent->nereids_id() == -1) {
131
12.5k
        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.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
221k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
221k
    if (_parent->nereids_id() == -1) {
131
221k
        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
221k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
427k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
428k
    if (_parent->nereids_id() == -1) {
131
428k
        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
427k
}
_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.2k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
30.2k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
30.2k
    _terminated = true;
143
30.2k
    return Status::OK();
144
30.2k
}
_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.37k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.37k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.37k
    _terminated = true;
143
2.37k
    return Status::OK();
144
2.37k
}
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.75k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.75k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.75k
    _terminated = true;
143
1.75k
    return Status::OK();
144
1.75k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
632
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
632
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
632
    _terminated = true;
143
632
    return Status::OK();
144
632
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
485
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
485
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
485
    _terminated = true;
143
485
    return Status::OK();
144
485
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
227
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
227
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
227
    _terminated = true;
143
227
    return Status::OK();
144
227
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
6
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
6
    _terminated = true;
143
6
    return Status::OK();
144
6
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
276
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
276
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
276
    _terminated = true;
143
276
    return Status::OK();
144
276
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
7
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
7
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
7
    _terminated = true;
143
7
    return Status::OK();
144
7
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
299
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
299
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
299
    _terminated = true;
143
299
    return Status::OK();
144
299
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
133
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
133
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
133
    _terminated = true;
143
133
    return Status::OK();
144
133
}
145
146
295k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
295k
    return _child && _child->is_serial_operator() && !is_source()
148
295k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
295k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
295k
}
151
152
24.4k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
24.4k
    if (!_child) {
154
23.2k
        return false;
155
23.2k
    }
156
1.16k
    if (_child->is_serial_operator()) {
157
174
        return true;
158
174
    }
159
990
    const auto child_distribution = _child->required_data_distribution(state);
160
990
    return child_distribution.need_local_exchange() &&
161
990
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.16k
}
163
164
template <typename SharedStateArg>
165
19.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.5k
    fmt::memory_buffer debug_string_buffer;
167
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.5k
    return fmt::to_string(debug_string_buffer);
169
19.5k
}
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
19.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.5k
    fmt::memory_buffer debug_string_buffer;
167
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.5k
    return fmt::to_string(debug_string_buffer);
169
19.5k
}
_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
19.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.5k
    fmt::memory_buffer debug_string_buffer;
174
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.5k
    return fmt::to_string(debug_string_buffer);
176
19.5k
}
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
19.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.5k
    fmt::memory_buffer debug_string_buffer;
174
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.5k
    return fmt::to_string(debug_string_buffer);
176
19.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
19.5k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
19.5k
    fmt::memory_buffer debug_string_buffer;
180
19.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
19.5k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
19.5k
                   _is_serial_operator);
183
19.5k
    return fmt::to_string(debug_string_buffer);
184
19.5k
}
185
186
19.5k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
19.5k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
19.5k
}
189
190
641k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
641k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
641k
    _nereids_id = tnode.nereids_id;
193
641k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.87k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.87k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.87k
            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.87k
    }
206
641k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
641k
    _op_name = substr + "_OPERATOR";
208
209
641k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
641k
    } else if (tnode.__isset.conjuncts) {
212
273k
        for (const auto& conjunct : tnode.conjuncts) {
213
273k
            VExprContextSPtr context;
214
273k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
273k
            _conjuncts.emplace_back(context);
216
273k
        }
217
99.1k
    }
218
219
    // create the projections expr
220
641k
    if (tnode.__isset.projections) {
221
260k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
260k
    }
223
641k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.88k
        DCHECK(has_projection()) << "no final projections";
225
3.88k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.58k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.58k
            VExprContextSPtrs projections;
228
6.58k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.58k
            _projection->intermediate_projections.push_back(projections);
230
6.58k
        }
231
3.88k
    }
232
641k
    return Status::OK();
233
641k
}
234
235
667k
Status OperatorXBase::prepare(RuntimeState* state) {
236
667k
    for (auto& conjunct : _conjuncts) {
237
273k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
273k
    }
239
667k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
617k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
340k
            return a->execute_cost() < b->execute_cost();
242
340k
        });
243
617k
    };
244
245
667k
    if (has_projection()) {
246
260k
        auto& projection = *_projection;
247
266k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.57k
            const auto& input_row_desc =
249
6.57k
                    i == 0 ? operator_row_desc_before_projection()
250
6.57k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.57k
            RETURN_IF_ERROR(
252
6.57k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.57k
        }
254
260k
        const auto& final_projection_input_row_desc =
255
260k
                projection.intermediate_output_row_descriptors.empty()
256
260k
                        ? operator_row_desc_before_projection()
257
260k
                        : projection.intermediate_output_row_descriptors.back();
258
260k
        RETURN_IF_ERROR(
259
260k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
260k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
260k
                                                      projection.output_row_descriptor));
262
260k
    }
263
264
667k
    for (auto& conjunct : _conjuncts) {
265
273k
        RETURN_IF_ERROR(conjunct->open(state));
266
273k
    }
267
667k
    if (has_projection()) {
268
260k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
260k
        for (auto& projections : _projection->intermediate_projections) {
270
6.58k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.58k
        }
272
260k
    }
273
667k
    if (_child && !is_source()) {
274
94.9k
        RETURN_IF_ERROR(_child->prepare(state));
275
94.9k
    }
276
277
667k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
667k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
667k
    return Status::OK();
283
667k
}
284
285
7.10k
Status OperatorXBase::terminate(RuntimeState* state) {
286
7.10k
    if (_child && !is_source()) {
287
820
        RETURN_IF_ERROR(_child->terminate(state));
288
820
    }
289
7.10k
    auto result = state->get_local_state_result(operator_id());
290
7.10k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
7.10k
    return result.value()->terminate(state);
294
7.10k
}
295
296
4.93M
Status OperatorXBase::close(RuntimeState* state) {
297
4.93M
    if (_child && !is_source()) {
298
885k
        RETURN_IF_ERROR(_child->close(state));
299
885k
    }
300
4.93M
    auto result = state->get_local_state_result(operator_id());
301
4.93M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.93M
    return result.value()->close(state);
305
4.93M
}
306
307
286k
void PipelineXLocalStateBase::clear_origin_block() {
308
286k
    _origin_block.clear_column_data(
309
286k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
286k
}
311
312
697k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
697k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
697k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
697k
    return Status::OK();
317
697k
}
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
286k
                                     Block* output_block) const {
326
286k
    auto* local_state = state->get_local_state(operator_id());
327
286k
    SCOPED_TIMER(local_state->exec_time_counter());
328
286k
    SCOPED_TIMER(local_state->_projection_timer);
329
286k
    const size_t rows = origin_block->rows();
330
286k
    if (rows == 0) {
331
151k
        return Status::OK();
332
151k
    }
333
134k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
134k
    {
336
134k
        Block input_block = *origin_block;
337
338
134k
        ColumnsWithTypeAndName new_columns;
339
134k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.66k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.66k
            new_columns.resize(projections.size());
345
71.1k
            for (int i = 0; i < projections.size(); i++) {
346
67.5k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
67.5k
                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
67.5k
            }
355
3.65k
            Block tmp_block {new_columns};
356
3.65k
            input_block.swap(tmp_block);
357
3.65k
        }
358
359
134k
        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
134k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
134k
                output_block, _projection->output_row_descriptor);
368
134k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
134k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
134k
        Columns shared_columns(mutable_columns.size());
371
372
788k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
654k
            ColumnPtr column_ptr;
374
654k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
654k
            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
654k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
654k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
654k
            if (column_ptr->is_exclusive()) {
386
235k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
418k
            } else {
388
418k
                shared_columns[i] = std::move(column_ptr);
389
418k
            }
390
654k
        }
391
392
134k
        scoped_mutable_block.restore();
393
789k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
654k
            if (shared_columns[i]) {
395
418k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
418k
            }
397
654k
        }
398
134k
    }
399
400
0
    origin_block->clear_column_data(
401
134k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
134k
    DCHECK_EQ(output_block->rows(), rows);
403
404
134k
    return Status::OK();
405
134k
}
406
407
4.33M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.33M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.33M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.33M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.33M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.33M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.33M
            if (_debug_point_count++ % 2 == 0) {
414
4.33M
                return Status::OK();
415
4.33M
            }
416
4.33M
        }
417
4.33M
    });
418
419
4.33M
    Status status;
420
4.33M
    auto* local_state = state->get_local_state(operator_id());
421
4.33M
    Defer defer([&]() {
422
4.33M
        if (status.ok()) {
423
4.33M
            local_state->update_output_block_counters(*block);
424
4.33M
        }
425
4.33M
    });
426
4.33M
    if (has_projection()) {
427
286k
        local_state->clear_origin_block();
428
286k
        status = get_block(state, &local_state->_origin_block, eos);
429
286k
        if (UNLIKELY(!status.ok())) {
430
26
            return status;
431
26
        }
432
286k
        status = do_projections(state, &local_state->_origin_block, block);
433
286k
        return status;
434
286k
    }
435
4.05M
    status = get_block(state, block, eos);
436
4.05M
    RETURN_IF_ERROR(block->check_type_and_column());
437
4.05M
    return status;
438
4.05M
}
439
440
2.63M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.63M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.53k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.53k
        *eos = true;
444
9.53k
    }
445
446
2.63M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.63M
        auto op_name = to_lower(_parent->_op_name);
448
2.63M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.63M
        arg_op_name = to_lower(arg_op_name);
450
451
2.63M
        if (op_name == arg_op_name) {
452
2.63M
            *eos = true;
453
2.63M
        }
454
2.63M
    });
455
456
2.63M
    if (auto rows = block->rows()) {
457
756k
        _num_rows_returned += rows;
458
756k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
756k
    }
460
2.63M
}
461
462
30.2k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
30.2k
    auto result = state->get_sink_local_state_result();
464
30.2k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
30.2k
    return result.value()->terminate(state);
468
30.2k
}
469
470
19.5k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
19.5k
    fmt::memory_buffer debug_string_buffer;
472
473
19.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
19.5k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
19.5k
    return fmt::to_string(debug_string_buffer);
476
19.5k
}
477
478
19.5k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
19.5k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
19.5k
}
481
482
338k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
338k
    std::string op_name = "UNKNOWN_SINK";
484
338k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
339k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
339k
        op_name = it->second;
488
339k
    }
489
338k
    _name = op_name + "_OPERATOR";
490
338k
    return Status::OK();
491
338k
}
492
493
280k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
280k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
280k
    _nereids_id = tnode.nereids_id;
496
280k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
280k
    _name = substr + "_SINK_OPERATOR";
498
280k
    return Status::OK();
499
280k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.68M
                                                            LocalSinkStateInfo& info) {
504
1.68M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.68M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.68M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.68M
    return Status::OK();
508
1.68M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
117k
                                                            LocalSinkStateInfo& info) {
504
117k
    auto local_state = LocalStateType::create_unique(this, state);
505
117k
    RETURN_IF_ERROR(local_state->init(state, info));
506
117k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
117k
    return Status::OK();
508
117k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
381k
                                                            LocalSinkStateInfo& info) {
504
381k
    auto local_state = LocalStateType::create_unique(this, state);
505
381k
    RETURN_IF_ERROR(local_state->init(state, info));
506
381k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
381k
    return Status::OK();
508
381k
}
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
352
                                                            LocalSinkStateInfo& info) {
504
352
    auto local_state = LocalStateType::create_unique(this, state);
505
352
    RETURN_IF_ERROR(local_state->init(state, info));
506
352
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
352
    return Status::OK();
508
352
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
46.8k
                                                            LocalSinkStateInfo& info) {
504
46.8k
    auto local_state = LocalStateType::create_unique(this, state);
505
46.8k
    RETURN_IF_ERROR(local_state->init(state, info));
506
46.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
46.8k
    return Status::OK();
508
46.8k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
30
                                                            LocalSinkStateInfo& info) {
504
30
    auto local_state = LocalStateType::create_unique(this, state);
505
30
    RETURN_IF_ERROR(local_state->init(state, info));
506
30
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
30
    return Status::OK();
508
30
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7.19k
                                                            LocalSinkStateInfo& info) {
504
7.19k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.19k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.19k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.19k
    return Status::OK();
508
7.19k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
21
                                                            LocalSinkStateInfo& info) {
504
21
    auto local_state = LocalStateType::create_unique(this, state);
505
21
    RETURN_IF_ERROR(local_state->init(state, info));
506
21
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
21
    return Status::OK();
508
21
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
210k
                                                            LocalSinkStateInfo& info) {
504
210k
    auto local_state = LocalStateType::create_unique(this, state);
505
210k
    RETURN_IF_ERROR(local_state->init(state, info));
506
210k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
210k
    return Status::OK();
508
210k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
41
                                                            LocalSinkStateInfo& info) {
504
41
    auto local_state = LocalStateType::create_unique(this, state);
505
41
    RETURN_IF_ERROR(local_state->init(state, info));
506
41
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
41
    return Status::OK();
508
41
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
221k
                                                            LocalSinkStateInfo& info) {
504
221k
    auto local_state = LocalStateType::create_unique(this, state);
505
221k
    RETURN_IF_ERROR(local_state->init(state, info));
506
221k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
221k
    return Status::OK();
508
221k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
89.0k
                                                            LocalSinkStateInfo& info) {
504
89.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
89.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
89.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
89.0k
    return Status::OK();
508
89.0k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
58.1k
                                                            LocalSinkStateInfo& info) {
504
58.1k
    auto local_state = LocalStateType::create_unique(this, state);
505
58.1k
    RETURN_IF_ERROR(local_state->init(state, info));
506
58.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
58.1k
    return Status::OK();
508
58.1k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
156
                                                            LocalSinkStateInfo& info) {
504
156
    auto local_state = LocalStateType::create_unique(this, state);
505
156
    RETURN_IF_ERROR(local_state->init(state, info));
506
156
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
156
    return Status::OK();
508
156
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
517k
                                                            LocalSinkStateInfo& info) {
504
517k
    auto local_state = LocalStateType::create_unique(this, state);
505
517k
    RETURN_IF_ERROR(local_state->init(state, info));
506
517k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
517k
    return Status::OK();
508
517k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.76k
                                                            LocalSinkStateInfo& info) {
504
5.76k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.76k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.76k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.76k
    return Status::OK();
508
5.76k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
9.80k
                                                            LocalSinkStateInfo& info) {
504
9.80k
    auto local_state = LocalStateType::create_unique(this, state);
505
9.80k
    RETURN_IF_ERROR(local_state->init(state, info));
506
9.80k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9.80k
    return Status::OK();
508
9.80k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1.84k
                                                            LocalSinkStateInfo& info) {
504
1.84k
    auto local_state = LocalStateType::create_unique(this, state);
505
1.84k
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.84k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.84k
    return Status::OK();
508
1.84k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
292
                                                            LocalSinkStateInfo& info) {
504
292
    auto local_state = LocalStateType::create_unique(this, state);
505
292
    RETURN_IF_ERROR(local_state->init(state, info));
506
292
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
292
    return Status::OK();
508
292
}
_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.57k
                                                            LocalSinkStateInfo& info) {
504
2.57k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.57k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.57k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.57k
    return Status::OK();
508
2.57k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.54k
                                                            LocalSinkStateInfo& info) {
504
2.54k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.54k
    return Status::OK();
508
2.54k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.47k
                                                            LocalSinkStateInfo& info) {
504
2.47k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.47k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.47k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.47k
    return Status::OK();
508
2.47k
}
_ZN5doris17DataSinkOperatorXINS_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
561
                                                            LocalSinkStateInfo& info) {
504
561
    auto local_state = LocalStateType::create_unique(this, state);
505
561
    RETURN_IF_ERROR(local_state->init(state, info));
506
561
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
561
    return Status::OK();
508
561
}
_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.37M
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.37M
    } else {
519
1.37M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.37M
        ss->id = operator_id();
521
1.37M
        for (auto& dest : dests_id()) {
522
1.36M
            ss->related_op_ids.insert(dest);
523
1.36M
        }
524
1.37M
        return ss;
525
1.37M
    }
526
1.37M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
103k
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
103k
    } else {
519
103k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
103k
        ss->id = operator_id();
521
103k
        for (auto& dest : dests_id()) {
522
103k
            ss->related_op_ids.insert(dest);
523
103k
        }
524
103k
        return ss;
525
103k
    }
526
103k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
382k
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
382k
    } else {
519
382k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
382k
        ss->id = operator_id();
521
382k
        for (auto& dest : dests_id()) {
522
382k
            ss->related_op_ids.insert(dest);
523
382k
        }
524
382k
        return ss;
525
382k
    }
526
382k
}
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
352
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
352
    } else {
519
352
        auto ss = LocalStateType::SharedStateType::create_shared();
520
352
        ss->id = operator_id();
521
352
        for (auto& dest : dests_id()) {
522
352
            ss->related_op_ids.insert(dest);
523
352
        }
524
352
        return ss;
525
352
    }
526
352
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46.9k
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.9k
    } else {
519
46.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46.9k
        ss->id = operator_id();
521
46.9k
        for (auto& dest : dests_id()) {
522
46.7k
            ss->related_op_ids.insert(dest);
523
46.7k
        }
524
46.9k
        return ss;
525
46.9k
    }
526
46.9k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
30
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
30
    } else {
519
30
        auto ss = LocalStateType::SharedStateType::create_shared();
520
30
        ss->id = operator_id();
521
30
        for (auto& dest : dests_id()) {
522
30
            ss->related_op_ids.insert(dest);
523
30
        }
524
30
        return ss;
525
30
    }
526
30
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
7.23k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
7.23k
    } else {
519
7.23k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7.23k
        ss->id = operator_id();
521
7.23k
        for (auto& dest : dests_id()) {
522
7.22k
            ss->related_op_ids.insert(dest);
523
7.22k
        }
524
7.23k
        return ss;
525
7.23k
    }
526
7.23k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
21
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
21
    } else {
519
21
        auto ss = LocalStateType::SharedStateType::create_shared();
520
21
        ss->id = operator_id();
521
21
        for (auto& dest : dests_id()) {
522
21
            ss->related_op_ids.insert(dest);
523
21
        }
524
21
        return ss;
525
21
    }
526
21
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
211k
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
211k
    } else {
519
211k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
211k
        ss->id = operator_id();
521
211k
        for (auto& dest : dests_id()) {
522
210k
            ss->related_op_ids.insert(dest);
523
210k
        }
524
211k
        return ss;
525
211k
    }
526
211k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_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_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
89.3k
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
89.3k
    } else {
519
89.3k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
89.3k
        ss->id = operator_id();
521
89.4k
        for (auto& dest : dests_id()) {
522
89.4k
            ss->related_op_ids.insert(dest);
523
89.4k
        }
524
89.3k
        return ss;
525
89.3k
    }
526
89.3k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
155
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
155
    } else {
519
155
        auto ss = LocalStateType::SharedStateType::create_shared();
520
155
        ss->id = operator_id();
521
155
        for (auto& dest : dests_id()) {
522
155
            ss->related_op_ids.insert(dest);
523
155
        }
524
155
        return ss;
525
155
    }
526
155
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
519k
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
519k
    } else {
519
519k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
519k
        ss->id = operator_id();
521
519k
        for (auto& dest : dests_id()) {
522
517k
            ss->related_op_ids.insert(dest);
523
517k
        }
524
519k
        return ss;
525
519k
    }
526
519k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
5.78k
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
5.78k
    } else {
519
5.78k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
5.78k
        ss->id = operator_id();
521
5.78k
        for (auto& dest : dests_id()) {
522
5.77k
            ss->related_op_ids.insert(dest);
523
5.77k
        }
524
5.78k
        return ss;
525
5.78k
    }
526
5.78k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
396
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
396
    } else {
519
396
        auto ss = LocalStateType::SharedStateType::create_shared();
520
396
        ss->id = operator_id();
521
396
        for (auto& dest : dests_id()) {
522
396
            ss->related_op_ids.insert(dest);
523
396
        }
524
396
        return ss;
525
396
    }
526
396
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.60k
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.60k
    } else {
519
2.60k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.60k
        ss->id = operator_id();
521
2.60k
        for (auto& dest : dests_id()) {
522
2.60k
            ss->related_op_ids.insert(dest);
523
2.60k
        }
524
2.60k
        return ss;
525
2.60k
    }
526
2.60k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.51k
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.51k
    } else {
519
2.51k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.51k
        ss->id = operator_id();
521
2.51k
        for (auto& dest : dests_id()) {
522
2.51k
            ss->related_op_ids.insert(dest);
523
2.51k
        }
524
2.51k
        return ss;
525
2.51k
    }
526
2.51k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
564
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
564
    } else {
519
564
        auto ss = LocalStateType::SharedStateType::create_shared();
520
564
        ss->id = operator_id();
521
564
        for (auto& dest : dests_id()) {
522
560
            ss->related_op_ids.insert(dest);
523
560
        }
524
564
        return ss;
525
564
    }
526
564
}
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
2.04M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.04M
    auto local_state = LocalStateType::create_unique(state, this);
531
2.04M
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.04M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.04M
    return Status::OK();
534
2.04M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
69.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
69.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
69.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
69.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
69.0k
    return Status::OK();
534
69.0k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
232k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
232k
    auto local_state = LocalStateType::create_unique(state, this);
531
232k
    RETURN_IF_ERROR(local_state->init(state, info));
532
232k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
232k
    return Status::OK();
534
232k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
114
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
114
    auto local_state = LocalStateType::create_unique(state, this);
531
114
    RETURN_IF_ERROR(local_state->init(state, info));
532
114
    state->emplace_local_state(operator_id(), std::move(local_state));
533
114
    return Status::OK();
534
114
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.18k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.18k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.18k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.18k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.18k
    return Status::OK();
534
7.18k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.06k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.06k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.06k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.06k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.06k
    return Status::OK();
534
7.06k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
35
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
35
    auto local_state = LocalStateType::create_unique(state, this);
531
35
    RETURN_IF_ERROR(local_state->init(state, info));
532
35
    state->emplace_local_state(operator_id(), std::move(local_state));
533
35
    return Status::OK();
534
35
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
203k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
203k
    auto local_state = LocalStateType::create_unique(state, this);
531
203k
    RETURN_IF_ERROR(local_state->init(state, info));
532
203k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
203k
    return Status::OK();
534
203k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
88.9k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
88.9k
    auto local_state = LocalStateType::create_unique(state, this);
531
88.9k
    RETURN_IF_ERROR(local_state->init(state, info));
532
88.9k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
88.9k
    return Status::OK();
534
88.9k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
58.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
58.4k
    auto local_state = LocalStateType::create_unique(state, this);
531
58.4k
    RETURN_IF_ERROR(local_state->init(state, info));
532
58.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
58.4k
    return Status::OK();
534
58.4k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
146
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
146
    auto local_state = LocalStateType::create_unique(state, this);
531
146
    RETURN_IF_ERROR(local_state->init(state, info));
532
146
    state->emplace_local_state(operator_id(), std::move(local_state));
533
146
    return Status::OK();
534
146
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.12k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.12k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.12k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.12k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.12k
    return Status::OK();
534
5.12k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
305k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
305k
    auto local_state = LocalStateType::create_unique(state, this);
531
305k
    RETURN_IF_ERROR(local_state->init(state, info));
532
305k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
305k
    return Status::OK();
534
305k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.47k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.47k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.47k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.47k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.47k
    return Status::OK();
534
1.47k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.75k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.75k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.75k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.75k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.75k
    return Status::OK();
534
5.75k
}
_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.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.5k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.5k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.5k
    return Status::OK();
534
54.5k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.87k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.87k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.87k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.87k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.87k
    return Status::OK();
534
4.87k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
294
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
294
    auto local_state = LocalStateType::create_unique(state, this);
531
294
    RETURN_IF_ERROR(local_state->init(state, info));
532
294
    state->emplace_local_state(operator_id(), std::move(local_state));
533
294
    return Status::OK();
534
294
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.57k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.57k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.57k
    return Status::OK();
534
2.57k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.46k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.46k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.46k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.46k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.46k
    return Status::OK();
534
2.46k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
318
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
318
    auto local_state = LocalStateType::create_unique(state, this);
531
318
    RETURN_IF_ERROR(local_state->init(state, info));
532
318
    state->emplace_local_state(operator_id(), std::move(local_state));
533
318
    return Status::OK();
534
318
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_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_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.3k
    return Status::OK();
534
10.3k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
623k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
623k
    auto local_state = LocalStateType::create_unique(state, this);
531
623k
    RETURN_IF_ERROR(local_state->init(state, info));
532
623k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
623k
    return Status::OK();
534
623k
}
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
786
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
786
    auto local_state = LocalStateType::create_unique(state, this);
531
786
    RETURN_IF_ERROR(local_state->init(state, info));
532
786
    state->emplace_local_state(operator_id(), std::move(local_state));
533
786
    return Status::OK();
534
786
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
959
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
959
    auto local_state = LocalStateType::create_unique(state, this);
531
959
    RETURN_IF_ERROR(local_state->init(state, info));
532
959
    state->emplace_local_state(operator_id(), std::move(local_state));
533
959
    return Status::OK();
534
959
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.32k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.32k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.32k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.32k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.32k
    return Status::OK();
534
8.32k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
345k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
345k
    auto local_state = LocalStateType::create_unique(state, this);
531
345k
    RETURN_IF_ERROR(local_state->init(state, info));
532
345k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
345k
    return Status::OK();
534
345k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.67M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
2.04M
        : _num_rows_returned(0),
542
2.04M
          _rows_returned_counter(nullptr),
543
2.04M
          _parent(parent),
544
2.04M
          _state(state),
545
2.04M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
2.05M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
2.05M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
2.05M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
2.05M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
2.05M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
2.05M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
2.05M
    _operator_profile->add_child(_common_profile.get(), true);
557
2.05M
    _operator_profile->add_child(_custom_profile.get(), true);
558
2.05M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
2.05M
    if constexpr (!is_fake_shared) {
560
1.13M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
694k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
694k
                                    .first.get()
563
694k
                                    ->template cast<SharedStateArg>();
564
565
694k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
694k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
694k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
694k
        } else if (info.shared_state) {
569
373k
            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
373k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
373k
            _dependency = _shared_state->create_source_dependency(
576
373k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
373k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
373k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
373k
        } else {
580
64.7k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
4.73k
                DCHECK(false);
582
4.73k
            }
583
64.7k
        }
584
1.13M
    }
585
586
2.05M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
2.05M
    _rows_returned_counter =
591
2.05M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
2.05M
    _blocks_returned_counter =
593
2.05M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
2.05M
    _output_block_bytes_counter =
595
2.05M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
2.05M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
2.05M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
2.05M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
2.05M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
2.05M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
2.05M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
2.05M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
2.05M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
2.05M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
2.05M
    _memory_used_counter =
606
2.05M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
2.05M
    _common_profile->add_info_string("IsColocate",
608
2.05M
                                     std::to_string(_parent->is_colocated_operator()));
609
2.05M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
2.05M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
2.05M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
2.05M
    return Status::OK();
613
2.05M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
69.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
69.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
69.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
69.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
69.2k
    _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
69.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
69.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
69.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
69.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
69.2k
    if constexpr (!is_fake_shared) {
560
69.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
13.8k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
13.8k
                                    .first.get()
563
13.8k
                                    ->template cast<SharedStateArg>();
564
565
13.8k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
13.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
13.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
55.4k
        } 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
54.5k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
54.5k
            _dependency = _shared_state->create_source_dependency(
576
54.5k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
54.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
54.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
54.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
914
        }
584
69.2k
    }
585
586
69.2k
    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
69.2k
    _rows_returned_counter =
591
69.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
69.2k
    _blocks_returned_counter =
593
69.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
69.2k
    _output_block_bytes_counter =
595
69.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
69.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
69.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
69.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
69.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
69.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
69.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
69.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
69.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
69.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
69.2k
    _memory_used_counter =
606
69.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
69.2k
    _common_profile->add_info_string("IsColocate",
608
69.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
69.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
69.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
69.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
69.2k
    return Status::OK();
613
69.2k
}
_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
210k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
210k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
210k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
210k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
210k
    _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
210k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
210k
    _operator_profile->add_child(_common_profile.get(), true);
557
210k
    _operator_profile->add_child(_custom_profile.get(), true);
558
210k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
210k
    if constexpr (!is_fake_shared) {
560
210k
        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
210k
        } 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
203k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
203k
            _dependency = _shared_state->create_source_dependency(
576
203k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
203k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
203k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
203k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
7.11k
        }
584
210k
    }
585
586
210k
    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
210k
    _rows_returned_counter =
591
210k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
210k
    _blocks_returned_counter =
593
210k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
210k
    _output_block_bytes_counter =
595
210k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
210k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
210k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
210k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
210k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
210k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
210k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
210k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
210k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
210k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
210k
    _memory_used_counter =
606
210k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
210k
    _common_profile->add_info_string("IsColocate",
608
210k
                                     std::to_string(_parent->is_colocated_operator()));
609
210k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
210k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
210k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
210k
    return Status::OK();
613
210k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
35
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
35
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
35
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
35
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
35
    _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
35
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
35
    _operator_profile->add_child(_common_profile.get(), true);
557
35
    _operator_profile->add_child(_custom_profile.get(), true);
558
35
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
35
    if constexpr (!is_fake_shared) {
560
35
        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
35
        } 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
34
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
34
            _dependency = _shared_state->create_source_dependency(
576
34
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
34
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
34
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
34
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
35
    }
585
586
35
    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
35
    _rows_returned_counter =
591
35
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
35
    _blocks_returned_counter =
593
35
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
35
    _output_block_bytes_counter =
595
35
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
35
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
35
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
35
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
35
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
35
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
35
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
35
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
35
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
35
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
35
    _memory_used_counter =
606
35
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
35
    _common_profile->add_info_string("IsColocate",
608
35
                                     std::to_string(_parent->is_colocated_operator()));
609
35
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
35
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
35
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
35
    return Status::OK();
613
35
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.77k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.77k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.77k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.77k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.77k
    _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.77k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.77k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.77k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.77k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.77k
    if constexpr (!is_fake_shared) {
560
5.77k
        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.77k
        } 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.69k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.69k
            _dependency = _shared_state->create_source_dependency(
576
5.69k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.69k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.69k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.69k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
78
        }
584
5.77k
    }
585
586
5.77k
    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.77k
    _rows_returned_counter =
591
5.77k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.77k
    _blocks_returned_counter =
593
5.77k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.77k
    _output_block_bytes_counter =
595
5.77k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.77k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.77k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.77k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.77k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.77k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.77k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.77k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.77k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.77k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.77k
    _memory_used_counter =
606
5.77k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.77k
    _common_profile->add_info_string("IsColocate",
608
5.77k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.77k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.77k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.77k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.77k
    return Status::OK();
613
5.77k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
7.23k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
7.23k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
7.23k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
7.23k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
7.23k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
7.23k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
7.23k
    _operator_profile->add_child(_common_profile.get(), true);
557
7.23k
    _operator_profile->add_child(_custom_profile.get(), true);
558
7.23k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
7.23k
    if constexpr (!is_fake_shared) {
560
7.23k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
7.23k
        } 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
7.16k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
7.16k
            _dependency = _shared_state->create_source_dependency(
576
7.16k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
7.16k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
7.16k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
7.16k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
77
        }
584
7.23k
    }
585
586
7.23k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
7.23k
    _rows_returned_counter =
591
7.23k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
7.23k
    _blocks_returned_counter =
593
7.23k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
7.23k
    _output_block_bytes_counter =
595
7.23k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.23k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
7.23k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
7.23k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
7.23k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
7.23k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
7.23k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
7.23k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
7.23k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
7.23k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
7.23k
    _memory_used_counter =
606
7.23k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
7.23k
    _common_profile->add_info_string("IsColocate",
608
7.23k
                                     std::to_string(_parent->is_colocated_operator()));
609
7.23k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
7.23k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
7.23k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
7.23k
    return Status::OK();
613
7.23k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
89.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
89.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
89.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
89.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
89.2k
    _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
89.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
89.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
89.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
89.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
89.2k
    if constexpr (!is_fake_shared) {
560
89.2k
        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
89.2k
        } 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
88.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
88.0k
            _dependency = _shared_state->create_source_dependency(
576
88.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
88.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
88.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
88.0k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.26k
        }
584
89.2k
    }
585
586
89.2k
    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
89.2k
    _rows_returned_counter =
591
89.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
89.2k
    _blocks_returned_counter =
593
89.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
89.2k
    _output_block_bytes_counter =
595
89.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
89.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
89.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
89.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
89.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
89.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
89.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
89.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
89.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
89.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
89.2k
    _memory_used_counter =
606
89.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
89.2k
    _common_profile->add_info_string("IsColocate",
608
89.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
89.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
89.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
89.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
89.2k
    return Status::OK();
613
89.2k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
58.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
58.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
58.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
58.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
58.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
58.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
58.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
58.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
58.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
58.5k
    if constexpr (!is_fake_shared) {
560
58.5k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
58.5k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
58.5k
                                    .first.get()
563
58.5k
                                    ->template cast<SharedStateArg>();
564
565
58.5k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
58.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
58.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } 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
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
58.5k
    }
585
586
58.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
58.5k
    _rows_returned_counter =
591
58.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
58.5k
    _blocks_returned_counter =
593
58.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
58.5k
    _output_block_bytes_counter =
595
58.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
58.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
58.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
58.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
58.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
58.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
58.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
58.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
58.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
58.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
58.5k
    _memory_used_counter =
606
58.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
58.5k
    _common_profile->add_info_string("IsColocate",
608
58.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
58.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
58.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
58.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
58.5k
    return Status::OK();
613
58.5k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
145
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
145
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
145
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
145
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
145
    _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
145
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
145
    _operator_profile->add_child(_common_profile.get(), true);
557
145
    _operator_profile->add_child(_custom_profile.get(), true);
558
145
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
145
    if constexpr (!is_fake_shared) {
560
145
        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
146
        } 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
146
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
146
            _dependency = _shared_state->create_source_dependency(
576
146
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
146
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
146
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
145
    }
585
586
146
    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
145
    _rows_returned_counter =
591
145
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
145
    _blocks_returned_counter =
593
145
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
145
    _output_block_bytes_counter =
595
145
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
145
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
145
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
145
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
145
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
145
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
145
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
145
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
145
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
145
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
145
    _memory_used_counter =
606
145
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
145
    _common_profile->add_info_string("IsColocate",
608
145
                                     std::to_string(_parent->is_colocated_operator()));
609
145
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
145
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
145
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
145
    return Status::OK();
613
145
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
918k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
918k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
918k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
918k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
918k
    _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
918k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
918k
    _operator_profile->add_child(_common_profile.get(), true);
557
918k
    _operator_profile->add_child(_custom_profile.get(), true);
558
918k
    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
918k
    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
918k
    _rows_returned_counter =
591
918k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
918k
    _blocks_returned_counter =
593
918k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
918k
    _output_block_bytes_counter =
595
918k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
918k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
918k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
918k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
918k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
918k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
918k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
918k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
918k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
918k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
918k
    _memory_used_counter =
606
918k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
918k
    _common_profile->add_info_string("IsColocate",
608
918k
                                     std::to_string(_parent->is_colocated_operator()));
609
918k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
918k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
918k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
918k
    return Status::OK();
613
918k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.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
54.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.5k
    if constexpr (!is_fake_shared) {
560
54.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
54.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
4.25k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.25k
            _dependency = _shared_state->create_source_dependency(
576
4.25k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.25k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.25k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.2k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
50.2k
        }
584
54.5k
    }
585
586
54.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
54.5k
    _rows_returned_counter =
591
54.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.5k
    _blocks_returned_counter =
593
54.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.5k
    _output_block_bytes_counter =
595
54.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.5k
    _memory_used_counter =
606
54.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.5k
    _common_profile->add_info_string("IsColocate",
608
54.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.5k
    return Status::OK();
613
54.5k
}
_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
4.88k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
4.88k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
4.88k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
4.88k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
4.88k
    _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
4.88k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
4.88k
    _operator_profile->add_child(_common_profile.get(), true);
557
4.88k
    _operator_profile->add_child(_custom_profile.get(), true);
558
4.88k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
4.88k
    if constexpr (!is_fake_shared) {
560
4.88k
        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
4.88k
        } 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.85k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.85k
            _dependency = _shared_state->create_source_dependency(
576
4.85k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.85k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.85k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.85k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
23
        }
584
4.88k
    }
585
586
4.88k
    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
4.88k
    _rows_returned_counter =
591
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
4.88k
    _blocks_returned_counter =
593
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
4.88k
    _output_block_bytes_counter =
595
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
4.88k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
4.88k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
4.88k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
4.88k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
4.88k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
4.88k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
4.88k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
4.88k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
4.88k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
4.88k
    _memory_used_counter =
606
4.88k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
4.88k
    _common_profile->add_info_string("IsColocate",
608
4.88k
                                     std::to_string(_parent->is_colocated_operator()));
609
4.88k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
4.88k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
4.88k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
4.88k
    return Status::OK();
613
4.88k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
394
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
394
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
394
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
394
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
394
    _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
394
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
394
    _operator_profile->add_child(_common_profile.get(), true);
557
394
    _operator_profile->add_child(_custom_profile.get(), true);
558
394
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
394
    if constexpr (!is_fake_shared) {
560
394
        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
394
        } 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
390
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
390
            _dependency = _shared_state->create_source_dependency(
576
390
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
390
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
390
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
390
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
4
        }
584
394
    }
585
586
394
    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
394
    _rows_returned_counter =
591
394
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
394
    _blocks_returned_counter =
593
394
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
394
    _output_block_bytes_counter =
595
394
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
394
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
394
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
394
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
394
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
394
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
394
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
394
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
394
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
394
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
394
    _memory_used_counter =
606
394
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
394
    _common_profile->add_info_string("IsColocate",
608
394
                                     std::to_string(_parent->is_colocated_operator()));
609
394
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
394
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
394
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
394
    return Status::OK();
613
394
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.11k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.11k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.11k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.11k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.11k
    _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.11k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.11k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.11k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.11k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.11k
    if constexpr (!is_fake_shared) {
560
5.11k
        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.11k
        } 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.80k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.80k
            _dependency = _shared_state->create_source_dependency(
576
4.80k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.80k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.80k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.80k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
308
        }
584
5.11k
    }
585
586
5.11k
    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.11k
    _rows_returned_counter =
591
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.11k
    _blocks_returned_counter =
593
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.11k
    _output_block_bytes_counter =
595
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.11k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.11k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.11k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.11k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.11k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.11k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.11k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.11k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.11k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.11k
    _memory_used_counter =
606
5.11k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.11k
    _common_profile->add_info_string("IsColocate",
608
5.11k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.11k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.11k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.11k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.11k
    return Status::OK();
613
5.11k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
626k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
626k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
626k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
626k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
626k
    _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
626k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
626k
    _operator_profile->add_child(_common_profile.get(), true);
557
626k
    _operator_profile->add_child(_custom_profile.get(), true);
558
626k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
626k
    if constexpr (!is_fake_shared) {
560
626k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
622k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
622k
                                    .first.get()
563
622k
                                    ->template cast<SharedStateArg>();
564
565
622k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
622k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
622k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
622k
        } 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
4.73k
        } else {
580
4.73k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
4.73k
                DCHECK(false);
582
4.73k
            }
583
4.73k
        }
584
626k
    }
585
586
626k
    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
626k
    _rows_returned_counter =
591
626k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
626k
    _blocks_returned_counter =
593
626k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
626k
    _output_block_bytes_counter =
595
626k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
626k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
626k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
626k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
626k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
626k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
626k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
626k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
626k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
626k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
626k
    _memory_used_counter =
606
626k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
626k
    _common_profile->add_info_string("IsColocate",
608
626k
                                     std::to_string(_parent->is_colocated_operator()));
609
626k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
626k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
626k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
626k
    return Status::OK();
613
626k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
169
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
169
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
169
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
169
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
169
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
169
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
169
    _operator_profile->add_child(_common_profile.get(), true);
557
169
    _operator_profile->add_child(_custom_profile.get(), true);
558
169
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
169
    if constexpr (!is_fake_shared) {
560
169
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
169
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
169
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
169
            _dependency = _shared_state->create_source_dependency(
576
169
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
169
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
169
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
169
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
169
    }
585
586
169
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
169
    _rows_returned_counter =
591
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
169
    _blocks_returned_counter =
593
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
169
    _output_block_bytes_counter =
595
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
169
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
169
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
169
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
169
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
169
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
169
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
169
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
169
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
169
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
169
    _memory_used_counter =
606
169
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
169
    _common_profile->add_info_string("IsColocate",
608
169
                                     std::to_string(_parent->is_colocated_operator()));
609
169
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
169
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
169
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
169
    return Status::OK();
613
169
}
614
615
template <typename SharedStateArg>
616
2.06M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.06M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.36M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
301k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
301k
    }
621
2.06M
    if (_parent->has_projection()) {
622
371k
        const auto& projection = *_parent->_projection;
623
371k
        _projections.resize(projection.projections.size());
624
2.31M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.94M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.94M
        }
627
371k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
385k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
13.9k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
208k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
194k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
194k
                        state, _intermediate_projections[i][j]));
633
194k
            }
634
13.9k
        }
635
371k
    }
636
2.06M
    return Status::OK();
637
2.06M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
69.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
69.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
70.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.42k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.42k
    }
621
69.4k
    if (_parent->has_projection()) {
622
69.3k
        const auto& projection = *_parent->_projection;
623
69.3k
        _projections.resize(projection.projections.size());
624
361k
        for (size_t i = 0; i < _projections.size(); i++) {
625
292k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
292k
        }
627
69.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
76.6k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.23k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
163k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
156k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
156k
                        state, _intermediate_projections[i][j]));
633
156k
            }
634
7.23k
        }
635
69.3k
    }
636
69.4k
    return Status::OK();
637
69.4k
}
_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
405
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
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
34
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
34
    _conjuncts.resize(_parent->_conjuncts.size());
618
34
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
34
    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
34
    return Status::OK();
637
34
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.79k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.79k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.88k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
95
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
95
    }
621
5.79k
    if (_parent->has_projection()) {
622
5.79k
        const auto& projection = *_parent->_projection;
623
5.79k
        _projections.resize(projection.projections.size());
624
25.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
20.0k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
20.0k
        }
627
5.79k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.81k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
24
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
206
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
182
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
182
                        state, _intermediate_projections[i][j]));
633
182
            }
634
24
        }
635
5.79k
    }
636
5.79k
    return Status::OK();
637
5.79k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
7.25k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
7.25k
    _conjuncts.resize(_parent->_conjuncts.size());
618
8.01k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
766
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
766
    }
621
7.25k
    if (_parent->has_projection()) {
622
3.92k
        const auto& projection = *_parent->_projection;
623
3.92k
        _projections.resize(projection.projections.size());
624
15.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
11.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
11.8k
        }
627
3.92k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.01k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
92
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
690
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
598
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
598
                        state, _intermediate_projections[i][j]));
633
598
            }
634
92
        }
635
3.92k
    }
636
7.25k
    return Status::OK();
637
7.25k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
89.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
89.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
91.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.67k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.67k
    }
621
89.4k
    if (_parent->has_projection()) {
622
30.7k
        const auto& projection = *_parent->_projection;
623
30.7k
        _projections.resize(projection.projections.size());
624
280k
        for (size_t i = 0; i < _projections.size(); i++) {
625
249k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
249k
        }
627
30.7k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
30.9k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
233
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.66k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
1.43k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
1.43k
                        state, _intermediate_projections[i][j]));
633
1.43k
            }
634
233
        }
635
30.7k
    }
636
89.4k
    return Status::OK();
637
89.4k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
58.5k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
58.5k
    _conjuncts.resize(_parent->_conjuncts.size());
618
58.5k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
11
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
11
    }
621
58.5k
    if (_parent->has_projection()) {
622
154
        const auto& projection = *_parent->_projection;
623
154
        _projections.resize(projection.projections.size());
624
673
        for (size_t i = 0; i < _projections.size(); i++) {
625
519
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
519
        }
627
154
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
156
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
2
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
15
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
13
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
13
                        state, _intermediate_projections[i][j]));
633
13
            }
634
2
        }
635
154
    }
636
58.5k
    return Status::OK();
637
58.5k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
149
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
149
    _conjuncts.resize(_parent->_conjuncts.size());
618
149
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
149
    if (_parent->has_projection()) {
622
120
        const auto& projection = *_parent->_projection;
623
120
        _projections.resize(projection.projections.size());
624
360
        for (size_t i = 0; i < _projections.size(); i++) {
625
240
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
240
        }
627
120
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
120
        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
120
    }
636
149
    return Status::OK();
637
149
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
923k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
923k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.21M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
296k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
296k
    }
621
923k
    if (_parent->has_projection()) {
622
249k
        const auto& projection = *_parent->_projection;
623
249k
        _projections.resize(projection.projections.size());
624
1.52M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.27M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.27M
        }
627
249k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
255k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.24k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
38.8k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
32.6k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
32.6k
                        state, _intermediate_projections[i][j]));
633
32.6k
            }
634
6.24k
        }
635
249k
    }
636
923k
    return Status::OK();
637
923k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.6k
    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.6k
    if (_parent->has_projection()) {
622
11.6k
        const auto& projection = *_parent->_projection;
623
11.6k
        _projections.resize(projection.projections.size());
624
111k
        for (size_t i = 0; i < _projections.size(); i++) {
625
100k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
100k
        }
627
11.6k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.8k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
165
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3.75k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3.59k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3.59k
                        state, _intermediate_projections[i][j]));
633
3.59k
            }
634
165
        }
635
11.6k
    }
636
54.6k
    return Status::OK();
637
54.6k
}
_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
4.86k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
4.86k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.44k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
579
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
579
    }
621
4.86k
    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
4.86k
    return Status::OK();
637
4.86k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
395
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
395
    _conjuncts.resize(_parent->_conjuncts.size());
618
395
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
395
    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
395
    return Status::OK();
637
395
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.17k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.17k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.17k
    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.17k
    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.17k
    return Status::OK();
637
5.17k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
629k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
629k
    _conjuncts.resize(_parent->_conjuncts.size());
618
629k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
629k
    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
629k
    return Status::OK();
637
629k
}
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.11k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.11k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7.11k
    _terminated = true;
645
7.11k
    return Status::OK();
646
7.11k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
424
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
424
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
424
    _terminated = true;
645
424
    return Status::OK();
646
424
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
18
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
18
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
18
    _terminated = true;
645
18
    return Status::OK();
646
18
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
84
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
84
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
84
    _terminated = true;
645
84
    return Status::OK();
646
84
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
2
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
2
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
2
    _terminated = true;
645
2
    return Status::OK();
646
2
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
17
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
17
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
17
    _terminated = true;
645
17
    return Status::OK();
646
17
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
5.61k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5.61k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
5.61k
    _terminated = true;
645
5.61k
    return Status::OK();
646
5.61k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
65
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
65
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
65
    _terminated = true;
645
65
    return Status::OK();
646
65
}
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
143
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
143
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
143
    _terminated = true;
645
143
    return Status::OK();
646
143
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
710
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
710
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
710
    _terminated = true;
645
710
    return Status::OK();
646
710
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
35
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
35
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
35
    _terminated = true;
645
35
    return Status::OK();
646
35
}
647
648
template <typename SharedStateArg>
649
2.30M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.30M
    if (_closed) {
651
240k
        return Status::OK();
652
240k
    }
653
2.05M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.13M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.13M
    }
656
2.05M
    _closed = true;
657
2.05M
    return Status::OK();
658
2.30M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
69.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
69.3k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
69.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
69.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
69.3k
    }
656
69.3k
    _closed = true;
657
69.3k
    return Status::OK();
658
69.3k
}
_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
419k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
419k
    if (_closed) {
651
209k
        return Status::OK();
652
209k
    }
653
209k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
209k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
209k
    }
656
209k
    _closed = true;
657
209k
    return Status::OK();
658
419k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
35
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
35
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
35
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
35
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
35
    }
656
35
    _closed = true;
657
35
    return Status::OK();
658
35
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.78k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.78k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.78k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.78k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.78k
    }
656
5.78k
    _closed = true;
657
5.78k
    return Status::OK();
658
5.78k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
14.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
14.6k
    if (_closed) {
651
7.42k
        return Status::OK();
652
7.42k
    }
653
7.22k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
7.22k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
7.22k
    }
656
7.22k
    _closed = true;
657
7.22k
    return Status::OK();
658
14.6k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
89.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
89.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
89.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
89.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
89.2k
    }
656
89.2k
    _closed = true;
657
89.2k
    return Status::OK();
658
89.2k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
58.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
58.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
58.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
58.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
58.2k
    }
656
58.2k
    _closed = true;
657
58.2k
    return Status::OK();
658
58.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
145
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
145
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
145
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
145
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
145
    }
656
145
    _closed = true;
657
145
    return Status::OK();
658
145
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
941k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
941k
    if (_closed) {
651
16.9k
        return Status::OK();
652
16.9k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
924k
    _closed = true;
657
924k
    return Status::OK();
658
941k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.6k
    }
656
54.6k
    _closed = true;
657
54.6k
    return Status::OK();
658
54.6k
}
_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
4.84k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4.84k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4.84k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4.84k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4.84k
    }
656
4.84k
    _closed = true;
657
4.84k
    return Status::OK();
658
4.84k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
586
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
586
    if (_closed) {
651
293
        return Status::OK();
652
293
    }
653
293
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
293
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
293
    }
656
293
    _closed = true;
657
293
    return Status::OK();
658
586
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.8k
    if (_closed) {
651
5.63k
        return Status::OK();
652
5.63k
    }
653
5.16k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.16k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.16k
    }
656
5.16k
    _closed = true;
657
5.16k
    return Status::OK();
658
10.8k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
630k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
630k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
630k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
630k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
630k
    }
656
630k
    _closed = true;
657
630k
    return Status::OK();
658
630k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
336
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
336
    if (_closed) {
651
176
        return Status::OK();
652
176
    }
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
336
}
659
660
template <typename SharedState>
661
1.68M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.68M
    _operator_profile =
664
1.68M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.68M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.68M
    _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.68M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.68M
    _operator_profile->add_child(_common_profile, true);
673
1.68M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.68M
    _operator_profile->set_metadata(_parent->node_id());
676
1.68M
    _wait_for_finish_dependency_timer =
677
1.68M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.68M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.68M
    if constexpr (!is_fake_shared) {
680
1.16M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.16M
            info.shared_state_map.end()) {
682
294k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
222k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
222k
            }
685
294k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
294k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
294k
                                                  ? 0
688
294k
                                                  : info.task_idx]
689
294k
                                  .get();
690
294k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
872k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
872k
            _shared_state = info.shared_state->template cast<SharedState>();
696
872k
            _dependency = _shared_state->create_sink_dependency(
697
872k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
872k
        }
699
1.16M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.16M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.16M
    }
702
703
1.68M
    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.68M
    _rows_input_counter =
708
1.68M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.68M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.68M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.68M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.68M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.68M
    _memory_used_counter =
714
1.68M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.68M
    _common_profile->add_info_string("IsColocate",
716
1.68M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.68M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.68M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.68M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.68M
    return Status::OK();
721
1.68M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
117k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
117k
    _operator_profile =
664
117k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
117k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
117k
    _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
117k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
117k
    _operator_profile->add_child(_common_profile, true);
673
117k
    _operator_profile->add_child(_custom_profile, true);
674
675
117k
    _operator_profile->set_metadata(_parent->node_id());
676
117k
    _wait_for_finish_dependency_timer =
677
117k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
117k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
117k
    if constexpr (!is_fake_shared) {
680
117k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
117k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
14.0k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
14.0k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
14.0k
                                                  ? 0
688
14.0k
                                                  : info.task_idx]
689
14.0k
                                  .get();
690
14.0k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
103k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
103k
            _shared_state = info.shared_state->template cast<SharedState>();
696
103k
            _dependency = _shared_state->create_sink_dependency(
697
103k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
103k
        }
699
117k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
117k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
117k
    }
702
703
117k
    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
117k
    _rows_input_counter =
708
117k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
117k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
117k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
117k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
117k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
117k
    _memory_used_counter =
714
117k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
117k
    _common_profile->add_info_string("IsColocate",
716
117k
                                     std::to_string(_parent->is_colocated_operator()));
717
117k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
117k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
117k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
117k
    return Status::OK();
721
117k
}
_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
211k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
211k
    _operator_profile =
664
211k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
211k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
211k
    _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
211k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
211k
    _operator_profile->add_child(_common_profile, true);
673
211k
    _operator_profile->add_child(_custom_profile, true);
674
675
211k
    _operator_profile->set_metadata(_parent->node_id());
676
211k
    _wait_for_finish_dependency_timer =
677
211k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
211k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
211k
    if constexpr (!is_fake_shared) {
680
211k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
211k
            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
211k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
211k
            _shared_state = info.shared_state->template cast<SharedState>();
696
211k
            _dependency = _shared_state->create_sink_dependency(
697
211k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
211k
        }
699
211k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
211k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
211k
    }
702
703
211k
    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
211k
    _rows_input_counter =
708
211k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
211k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
211k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
211k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
211k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
211k
    _memory_used_counter =
714
211k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
211k
    _common_profile->add_info_string("IsColocate",
716
211k
                                     std::to_string(_parent->is_colocated_operator()));
717
211k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
211k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
211k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
211k
    return Status::OK();
721
211k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
42
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
42
    _operator_profile =
664
42
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
42
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
42
    _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
42
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
42
    _operator_profile->add_child(_common_profile, true);
673
42
    _operator_profile->add_child(_custom_profile, true);
674
675
42
    _operator_profile->set_metadata(_parent->node_id());
676
42
    _wait_for_finish_dependency_timer =
677
42
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
42
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
42
    if constexpr (!is_fake_shared) {
680
42
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
42
            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
42
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
42
            _shared_state = info.shared_state->template cast<SharedState>();
696
42
            _dependency = _shared_state->create_sink_dependency(
697
42
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
42
        }
699
42
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
42
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
42
    }
702
703
42
    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
42
    _rows_input_counter =
708
42
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
42
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
42
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
42
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
42
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
42
    _memory_used_counter =
714
42
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
42
    _common_profile->add_info_string("IsColocate",
716
42
                                     std::to_string(_parent->is_colocated_operator()));
717
42
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
42
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
42
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
42
    return Status::OK();
721
42
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.77k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.77k
    _operator_profile =
664
5.77k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.77k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.77k
    _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
5.77k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.77k
    _operator_profile->add_child(_common_profile, true);
673
5.77k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.77k
    _operator_profile->set_metadata(_parent->node_id());
676
5.77k
    _wait_for_finish_dependency_timer =
677
5.77k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.77k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.77k
    if constexpr (!is_fake_shared) {
680
5.77k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.77k
            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
5.77k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.77k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.77k
            _dependency = _shared_state->create_sink_dependency(
697
5.77k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.77k
        }
699
5.77k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.77k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.77k
    }
702
703
5.77k
    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
5.77k
    _rows_input_counter =
708
5.77k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.77k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.77k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.77k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.77k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.77k
    _memory_used_counter =
714
5.77k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.77k
    _common_profile->add_info_string("IsColocate",
716
5.77k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.77k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.77k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.77k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.77k
    return Status::OK();
721
5.77k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.22k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.22k
    _operator_profile =
664
7.22k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.22k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.22k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
7.22k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.22k
    _operator_profile->add_child(_common_profile, true);
673
7.22k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.22k
    _operator_profile->set_metadata(_parent->node_id());
676
7.22k
    _wait_for_finish_dependency_timer =
677
7.22k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.22k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.22k
    if constexpr (!is_fake_shared) {
680
7.22k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.22k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
7.22k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.22k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.22k
            _dependency = _shared_state->create_sink_dependency(
697
7.22k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.22k
        }
699
7.22k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.22k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.22k
    }
702
703
7.22k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
7.22k
    _rows_input_counter =
708
7.22k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.22k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.22k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.22k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.22k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.22k
    _memory_used_counter =
714
7.22k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.22k
    _common_profile->add_info_string("IsColocate",
716
7.22k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.22k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.22k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.22k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.22k
    return Status::OK();
721
7.22k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
89.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
89.3k
    _operator_profile =
664
89.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
89.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
89.3k
    _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
89.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
89.3k
    _operator_profile->add_child(_common_profile, true);
673
89.3k
    _operator_profile->add_child(_custom_profile, true);
674
675
89.3k
    _operator_profile->set_metadata(_parent->node_id());
676
89.3k
    _wait_for_finish_dependency_timer =
677
89.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
89.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
89.3k
    if constexpr (!is_fake_shared) {
680
89.3k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
89.3k
            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
89.3k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
89.3k
            _shared_state = info.shared_state->template cast<SharedState>();
696
89.3k
            _dependency = _shared_state->create_sink_dependency(
697
89.3k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
89.3k
        }
699
89.3k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
89.3k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
89.3k
    }
702
703
89.3k
    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
89.3k
    _rows_input_counter =
708
89.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
89.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
89.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
89.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
89.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
89.3k
    _memory_used_counter =
714
89.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
89.3k
    _common_profile->add_info_string("IsColocate",
716
89.3k
                                     std::to_string(_parent->is_colocated_operator()));
717
89.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
89.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
89.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
89.3k
    return Status::OK();
721
89.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
58.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
58.4k
    _operator_profile =
664
58.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
58.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
58.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
58.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
58.4k
    _operator_profile->add_child(_common_profile, true);
673
58.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
58.4k
    _operator_profile->set_metadata(_parent->node_id());
676
58.4k
    _wait_for_finish_dependency_timer =
677
58.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
58.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
58.4k
    if constexpr (!is_fake_shared) {
680
58.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
58.5k
            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
58.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
58.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
58.5k
                                                  ? 0
688
58.5k
                                                  : info.task_idx]
689
58.5k
                                  .get();
690
58.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
58.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
58.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
58.4k
    }
702
703
58.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
58.4k
    _rows_input_counter =
708
58.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
58.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
58.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
58.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
58.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
58.4k
    _memory_used_counter =
714
58.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
58.4k
    _common_profile->add_info_string("IsColocate",
716
58.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
58.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
58.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
58.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
58.4k
    return Status::OK();
721
58.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
155
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
155
    _operator_profile =
664
155
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
155
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
155
    _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
155
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
155
    _operator_profile->add_child(_common_profile, true);
673
155
    _operator_profile->add_child(_custom_profile, true);
674
675
155
    _operator_profile->set_metadata(_parent->node_id());
676
155
    _wait_for_finish_dependency_timer =
677
155
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
155
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
155
    if constexpr (!is_fake_shared) {
680
155
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
155
            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
155
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
155
            _shared_state = info.shared_state->template cast<SharedState>();
696
155
            _dependency = _shared_state->create_sink_dependency(
697
155
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
155
        }
699
155
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
155
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
155
    }
702
703
156
    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
155
    _rows_input_counter =
708
155
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
155
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
155
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
155
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
155
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
155
    _memory_used_counter =
714
155
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
155
    _common_profile->add_info_string("IsColocate",
716
155
                                     std::to_string(_parent->is_colocated_operator()));
717
155
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
155
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
155
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
155
    return Status::OK();
721
155
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
521k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
521k
    _operator_profile =
664
521k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
521k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
521k
    _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
521k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
521k
    _operator_profile->add_child(_common_profile, true);
673
521k
    _operator_profile->add_child(_custom_profile, true);
674
675
521k
    _operator_profile->set_metadata(_parent->node_id());
676
521k
    _wait_for_finish_dependency_timer =
677
521k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
521k
    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
521k
    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
521k
    _rows_input_counter =
708
521k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
521k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
521k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
521k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
521k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
521k
    _memory_used_counter =
714
521k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
521k
    _common_profile->add_info_string("IsColocate",
716
521k
                                     std::to_string(_parent->is_colocated_operator()));
717
521k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
521k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
521k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
521k
    return Status::OK();
721
521k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
9.83k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
9.83k
    _operator_profile =
664
9.83k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
9.83k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
9.83k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
9.83k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
9.83k
    _operator_profile->add_child(_common_profile, true);
673
9.83k
    _operator_profile->add_child(_custom_profile, true);
674
675
9.83k
    _operator_profile->set_metadata(_parent->node_id());
676
9.83k
    _wait_for_finish_dependency_timer =
677
9.83k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
9.83k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
9.83k
    if constexpr (!is_fake_shared) {
680
9.83k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
9.83k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
9.83k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
9.83k
            _shared_state = info.shared_state->template cast<SharedState>();
696
9.83k
            _dependency = _shared_state->create_sink_dependency(
697
9.83k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
9.83k
        }
699
9.83k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
9.83k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
9.83k
    }
702
703
9.83k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
9.83k
    _rows_input_counter =
708
9.83k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
9.83k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
9.83k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
9.83k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
9.83k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
9.83k
    _memory_used_counter =
714
9.83k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
9.83k
    _common_profile->add_info_string("IsColocate",
716
9.83k
                                     std::to_string(_parent->is_colocated_operator()));
717
9.83k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
9.83k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
9.83k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
9.83k
    return Status::OK();
721
9.83k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
396
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
396
    _operator_profile =
664
396
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
396
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
396
    _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
396
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
396
    _operator_profile->add_child(_common_profile, true);
673
396
    _operator_profile->add_child(_custom_profile, true);
674
675
396
    _operator_profile->set_metadata(_parent->node_id());
676
396
    _wait_for_finish_dependency_timer =
677
396
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
396
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
396
    if constexpr (!is_fake_shared) {
680
396
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
396
            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
396
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
396
            _shared_state = info.shared_state->template cast<SharedState>();
696
396
            _dependency = _shared_state->create_sink_dependency(
697
396
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
396
        }
699
396
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
396
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
396
    }
702
703
396
    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
396
    _rows_input_counter =
708
396
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
396
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
396
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
396
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
396
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
396
    _memory_used_counter =
714
396
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
396
    _common_profile->add_info_string("IsColocate",
716
396
                                     std::to_string(_parent->is_colocated_operator()));
717
396
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
396
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
396
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
396
    return Status::OK();
721
396
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
1.84k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.84k
    _operator_profile =
664
1.84k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.84k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.84k
    _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.84k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.84k
    _operator_profile->add_child(_common_profile, true);
673
1.84k
    _operator_profile->add_child(_custom_profile, true);
674
675
1.84k
    _operator_profile->set_metadata(_parent->node_id());
676
1.84k
    _wait_for_finish_dependency_timer =
677
1.84k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.84k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.84k
    if constexpr (!is_fake_shared) {
680
1.84k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.84k
            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
1.84k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
1.84k
            _shared_state = info.shared_state->template cast<SharedState>();
696
1.84k
            _dependency = _shared_state->create_sink_dependency(
697
1.84k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
1.84k
        }
699
1.84k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.84k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.84k
    }
702
703
1.84k
    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.84k
    _rows_input_counter =
708
1.84k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.84k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.84k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.84k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.84k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.84k
    _memory_used_counter =
714
1.84k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.84k
    _common_profile->add_info_string("IsColocate",
716
1.84k
                                     std::to_string(_parent->is_colocated_operator()));
717
1.84k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.84k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.84k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.84k
    return Status::OK();
721
1.84k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.5k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.5k
    _operator_profile =
664
12.5k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.5k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.5k
    _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.5k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.5k
    _operator_profile->add_child(_common_profile, true);
673
12.5k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.5k
    _operator_profile->set_metadata(_parent->node_id());
676
12.5k
    _wait_for_finish_dependency_timer =
677
12.5k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.5k
    if constexpr (!is_fake_shared) {
680
12.5k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.5k
            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.5k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.5k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.5k
            _dependency = _shared_state->create_sink_dependency(
697
12.5k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.5k
        }
699
12.5k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.5k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.5k
    }
702
703
12.5k
    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.5k
    _rows_input_counter =
708
12.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.5k
    _memory_used_counter =
714
12.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.5k
    _common_profile->add_info_string("IsColocate",
716
12.5k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.5k
    return Status::OK();
721
12.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
221k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
221k
    _operator_profile =
664
221k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
221k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
221k
    _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
221k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
221k
    _operator_profile->add_child(_common_profile, true);
673
221k
    _operator_profile->add_child(_custom_profile, true);
674
675
221k
    _operator_profile->set_metadata(_parent->node_id());
676
221k
    _wait_for_finish_dependency_timer =
677
221k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
221k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
221k
    if constexpr (!is_fake_shared) {
680
221k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
222k
            info.shared_state_map.end()) {
682
222k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
222k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
222k
            }
685
222k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
222k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
222k
                                                  ? 0
688
222k
                                                  : info.task_idx]
689
222k
                                  .get();
690
222k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
221k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
221k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
221k
    }
702
703
221k
    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
221k
    _rows_input_counter =
708
221k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
221k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
221k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
221k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
221k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
221k
    _memory_used_counter =
714
221k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
221k
    _common_profile->add_info_string("IsColocate",
716
221k
                                     std::to_string(_parent->is_colocated_operator()));
717
221k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
221k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
221k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
221k
    return Status::OK();
721
221k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
430k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
430k
    _operator_profile =
664
430k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
430k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
430k
    _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
430k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
430k
    _operator_profile->add_child(_common_profile, true);
673
430k
    _operator_profile->add_child(_custom_profile, true);
674
675
430k
    _operator_profile->set_metadata(_parent->node_id());
676
430k
    _wait_for_finish_dependency_timer =
677
430k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
430k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
430k
    if constexpr (!is_fake_shared) {
680
430k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
430k
            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
430k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
430k
            _shared_state = info.shared_state->template cast<SharedState>();
696
430k
            _dependency = _shared_state->create_sink_dependency(
697
430k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
430k
        }
699
430k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
430k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
430k
    }
702
703
430k
    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
430k
    _rows_input_counter =
708
430k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
430k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
430k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
430k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
430k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
430k
    _memory_used_counter =
714
430k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
430k
    _common_profile->add_info_string("IsColocate",
716
430k
                                     std::to_string(_parent->is_colocated_operator()));
717
430k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
430k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
430k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
430k
    return Status::OK();
721
430k
}
_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.69M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.69M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.69M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.16M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.16M
    }
731
1.69M
    _closed = true;
732
1.69M
    return Status::OK();
733
1.69M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
117k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
117k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
117k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
117k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
117k
    }
731
117k
    _closed = true;
732
117k
    return Status::OK();
733
117k
}
_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
33
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
33
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
31
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
31
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
31
    }
731
31
    _closed = true;
732
31
    return Status::OK();
733
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.77k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.77k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.77k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.77k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.77k
    }
731
5.77k
    _closed = true;
732
5.77k
    return Status::OK();
733
5.77k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.20k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.20k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.20k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.20k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.20k
    }
731
7.20k
    _closed = true;
732
7.20k
    return Status::OK();
733
7.20k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
89.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
89.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
89.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
89.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
89.0k
    }
731
89.0k
    _closed = true;
732
89.0k
    return Status::OK();
733
89.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
58.3k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
58.3k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
58.3k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
58.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
58.3k
    }
731
58.3k
    _closed = true;
732
58.3k
    return Status::OK();
733
58.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
145
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
145
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
145
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
145
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
145
    }
731
145
    _closed = true;
732
145
    return Status::OK();
733
145
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
521k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
521k
    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
521k
    _closed = true;
732
521k
    return Status::OK();
733
521k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
9.84k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
9.84k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
9.84k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
9.84k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
9.84k
    }
731
9.84k
    _closed = true;
732
9.84k
    return Status::OK();
733
9.84k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
294
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
294
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
294
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
294
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
294
    }
731
294
    _closed = true;
732
294
    return Status::OK();
733
294
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1.84k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.84k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1.84k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.84k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.84k
    }
731
1.84k
    _closed = true;
732
1.84k
    return Status::OK();
733
1.84k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.6k
    }
731
12.6k
    _closed = true;
732
12.6k
    return Status::OK();
733
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
222k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
222k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
222k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
222k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
222k
    }
731
222k
    _closed = true;
732
222k
    return Status::OK();
733
222k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
432k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
432k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
432k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
432k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
432k
    }
731
432k
    _closed = true;
732
432k
    return Status::OK();
733
432k
}
_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.14k
                                                          bool* eos) {
738
7.14k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.14k
    return pull(state, block, eos);
740
7.14k
}
_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.11k
                                                          bool* eos) {
738
7.11k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.10k
    return pull(state, block, eos);
740
7.11k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
587k
                                                         bool* eos) {
745
587k
    auto& local_state = get_local_state(state);
746
587k
    if (need_more_input_data(state)) {
747
555k
        local_state._child_block->clear_column_data(
748
555k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
555k
                        .num_materialized_slots());
750
555k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
555k
                state, local_state._child_block.get(), &local_state._child_eos));
752
555k
        *eos = local_state._child_eos;
753
555k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
57.3k
            return Status::OK();
755
57.3k
        }
756
497k
        {
757
497k
            SCOPED_TIMER(local_state.exec_time_counter());
758
497k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
497k
        }
760
497k
    }
761
762
530k
    if (!need_more_input_data(state)) {
763
498k
        SCOPED_TIMER(local_state.exec_time_counter());
764
498k
        bool new_eos = false;
765
498k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
498k
        if (new_eos) {
767
412k
            *eos = true;
768
412k
        } else if (!need_more_input_data(state)) {
769
25.5k
            *eos = false;
770
25.5k
        }
771
498k
    }
772
530k
    return Status::OK();
773
530k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
144k
                                                         bool* eos) {
745
144k
    auto& local_state = get_local_state(state);
746
144k
    if (need_more_input_data(state)) {
747
126k
        local_state._child_block->clear_column_data(
748
126k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
126k
                        .num_materialized_slots());
750
126k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
126k
                state, local_state._child_block.get(), &local_state._child_eos));
752
126k
        *eos = local_state._child_eos;
753
126k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
36.5k
            return Status::OK();
755
36.5k
        }
756
89.5k
        {
757
89.5k
            SCOPED_TIMER(local_state.exec_time_counter());
758
89.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
89.5k
        }
760
89.5k
    }
761
762
108k
    if (!need_more_input_data(state)) {
763
108k
        SCOPED_TIMER(local_state.exec_time_counter());
764
108k
        bool new_eos = false;
765
108k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
108k
        if (new_eos) {
767
45.0k
            *eos = true;
768
63.3k
        } else if (!need_more_input_data(state)) {
769
11.0k
            *eos = false;
770
11.0k
        }
771
108k
    }
772
108k
    return Status::OK();
773
108k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.47k
                                                         bool* eos) {
745
4.47k
    auto& local_state = get_local_state(state);
746
4.47k
    if (need_more_input_data(state)) {
747
2.48k
        local_state._child_block->clear_column_data(
748
2.48k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.48k
                        .num_materialized_slots());
750
2.48k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.48k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.48k
        *eos = local_state._child_eos;
753
2.48k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
387
            return Status::OK();
755
387
        }
756
2.09k
        {
757
2.09k
            SCOPED_TIMER(local_state.exec_time_counter());
758
2.09k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
2.09k
        }
760
2.09k
    }
761
762
4.11k
    if (!need_more_input_data(state)) {
763
4.11k
        SCOPED_TIMER(local_state.exec_time_counter());
764
4.11k
        bool new_eos = false;
765
4.11k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
4.11k
        if (new_eos) {
767
1.48k
            *eos = true;
768
2.62k
        } else if (!need_more_input_data(state)) {
769
2.00k
            *eos = false;
770
2.00k
        }
771
4.11k
    }
772
4.09k
    return Status::OK();
773
4.09k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.81k
                                                         bool* eos) {
745
1.81k
    auto& local_state = get_local_state(state);
746
1.81k
    if (need_more_input_data(state)) {
747
1.81k
        local_state._child_block->clear_column_data(
748
1.81k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.81k
                        .num_materialized_slots());
750
1.81k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.81k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.81k
        *eos = local_state._child_eos;
753
1.81k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
764
            return Status::OK();
755
764
        }
756
1.05k
        {
757
1.05k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.05k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.05k
        }
760
1.05k
    }
761
762
1.05k
    if (!need_more_input_data(state)) {
763
1.05k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.05k
        bool new_eos = false;
765
1.05k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.05k
        if (new_eos) {
767
786
            *eos = true;
768
786
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.05k
    }
772
1.05k
    return Status::OK();
773
1.05k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
24.1k
                                                         bool* eos) {
745
24.1k
    auto& local_state = get_local_state(state);
746
24.1k
    if (need_more_input_data(state)) {
747
24.1k
        local_state._child_block->clear_column_data(
748
24.1k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
24.1k
                        .num_materialized_slots());
750
24.1k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
24.1k
                state, local_state._child_block.get(), &local_state._child_eos));
752
24.1k
        *eos = local_state._child_eos;
753
24.1k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
5.17k
            return Status::OK();
755
5.17k
        }
756
19.0k
        {
757
19.0k
            SCOPED_TIMER(local_state.exec_time_counter());
758
19.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
19.0k
        }
760
19.0k
    }
761
762
18.9k
    if (!need_more_input_data(state)) {
763
8.35k
        SCOPED_TIMER(local_state.exec_time_counter());
764
8.35k
        bool new_eos = false;
765
8.35k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
8.35k
        if (new_eos) {
767
8.28k
            *eos = true;
768
8.28k
        } else if (!need_more_input_data(state)) {
769
7
            *eos = false;
770
7
        }
771
8.35k
    }
772
18.9k
    return Status::OK();
773
18.9k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
380k
                                                         bool* eos) {
745
380k
    auto& local_state = get_local_state(state);
746
380k
    if (need_more_input_data(state)) {
747
380k
        local_state._child_block->clear_column_data(
748
380k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
380k
                        .num_materialized_slots());
750
380k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
380k
                state, local_state._child_block.get(), &local_state._child_eos));
752
380k
        *eos = local_state._child_eos;
753
380k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
12.2k
            return Status::OK();
755
12.2k
        }
756
368k
        {
757
368k
            SCOPED_TIMER(local_state.exec_time_counter());
758
368k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
368k
        }
760
368k
    }
761
762
367k
    if (!need_more_input_data(state)) {
763
346k
        SCOPED_TIMER(local_state.exec_time_counter());
764
346k
        bool new_eos = false;
765
346k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
346k
        if (new_eos) {
767
346k
            *eos = true;
768
346k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
346k
    }
772
367k
    return Status::OK();
773
367k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
23.8k
                                                         bool* eos) {
745
23.8k
    auto& local_state = get_local_state(state);
746
23.8k
    if (need_more_input_data(state)) {
747
11.7k
        local_state._child_block->clear_column_data(
748
11.7k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
11.7k
                        .num_materialized_slots());
750
11.7k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
11.7k
                state, local_state._child_block.get(), &local_state._child_eos));
752
11.7k
        *eos = local_state._child_eos;
753
11.7k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.29k
            return Status::OK();
755
1.29k
        }
756
10.4k
        {
757
10.4k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.4k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.4k
        }
760
10.4k
    }
761
762
22.5k
    if (!need_more_input_data(state)) {
763
21.9k
        SCOPED_TIMER(local_state.exec_time_counter());
764
21.9k
        bool new_eos = false;
765
21.9k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
21.9k
        if (new_eos) {
767
5.76k
            *eos = true;
768
16.2k
        } else if (!need_more_input_data(state)) {
769
12.0k
            *eos = false;
770
12.0k
        }
771
21.9k
    }
772
22.5k
    return Status::OK();
773
22.5k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
8.29k
                                                         bool* eos) {
745
8.29k
    auto& local_state = get_local_state(state);
746
8.29k
    if (need_more_input_data(state)) {
747
7.93k
        local_state._child_block->clear_column_data(
748
7.93k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
7.93k
                        .num_materialized_slots());
750
7.93k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
7.93k
                state, local_state._child_block.get(), &local_state._child_eos));
752
7.93k
        *eos = local_state._child_eos;
753
7.93k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.04k
            return Status::OK();
755
1.04k
        }
756
6.89k
        {
757
6.89k
            SCOPED_TIMER(local_state.exec_time_counter());
758
6.89k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
6.89k
        }
760
6.89k
    }
761
762
7.25k
    if (!need_more_input_data(state)) {
763
7.25k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.25k
        bool new_eos = false;
765
7.25k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.25k
        if (new_eos) {
767
5.10k
            *eos = true;
768
5.10k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
7.25k
    }
772
7.24k
    return Status::OK();
773
7.24k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
46.8k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.8k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.8k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.8k
                                                         "AsyncWriterDependency", true);
781
46.8k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.8k
                             _finish_dependency));
783
784
46.8k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.8k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.8k
    return Status::OK();
787
46.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
352
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
352
    RETURN_IF_ERROR(Base::init(state, info));
779
352
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
352
                                                         "AsyncWriterDependency", true);
781
352
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
352
                             _finish_dependency));
783
784
352
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
352
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
352
    return Status::OK();
787
352
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
46.4k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.4k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.4k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.4k
                                                         "AsyncWriterDependency", true);
781
46.4k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.4k
                             _finish_dependency));
783
784
46.4k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.4k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.4k
    return Status::OK();
787
46.4k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
30
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
30
    RETURN_IF_ERROR(Base::init(state, info));
779
30
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
30
                                                         "AsyncWriterDependency", true);
781
30
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
30
                             _finish_dependency));
783
784
30
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
30
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
30
    return Status::OK();
787
30
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
47.4k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.4k
    RETURN_IF_ERROR(Base::open(state));
793
47.4k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
367k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
320k
        RETURN_IF_ERROR(
796
320k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
320k
    }
798
47.4k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.4k
    return Status::OK();
800
47.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
352
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
352
    RETURN_IF_ERROR(Base::open(state));
793
352
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.83k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.48k
        RETURN_IF_ERROR(
796
1.48k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.48k
    }
798
352
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
352
    return Status::OK();
800
352
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
47.0k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.0k
    RETURN_IF_ERROR(Base::open(state));
793
47.0k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
365k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
318k
        RETURN_IF_ERROR(
796
318k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
318k
    }
798
47.0k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.0k
    return Status::OK();
800
47.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
30
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
30
    RETURN_IF_ERROR(Base::open(state));
793
30
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
540
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
510
        RETURN_IF_ERROR(
796
510
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
510
    }
798
30
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
30
    return Status::OK();
800
30
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
62.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.5k
    return _writer->sink(block, eos);
806
62.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.28k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.28k
    return _writer->sink(block, eos);
806
1.28k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
61.2k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.2k
    return _writer->sink(block, eos);
806
61.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
30
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
30
    return _writer->sink(block, eos);
806
30
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
47.4k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.4k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.4k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.4k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
47.5k
    if (_writer) {
818
47.5k
        Status st = _writer->get_writer_status();
819
47.5k
        if (exec_status.ok()) {
820
47.4k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.4k
                                                       : Status::Cancelled("force close"));
822
47.4k
        } else {
823
87
            _writer->force_close(exec_status);
824
87
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
47.5k
        RETURN_IF_ERROR(st);
829
47.5k
    }
830
47.4k
    return Base::close(state, exec_status);
831
47.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
340
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
340
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
340
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
340
    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
340
    if (_writer) {
818
340
        Status st = _writer->get_writer_status();
819
340
        if (exec_status.ok()) {
820
340
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
340
                                                       : Status::Cancelled("force close"));
822
340
        } 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
340
        RETURN_IF_ERROR(st);
829
340
    }
830
340
    return Base::close(state, exec_status);
831
340
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
47.1k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.1k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.1k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.1k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
47.1k
    if (_writer) {
818
47.1k
        Status st = _writer->get_writer_status();
819
47.1k
        if (exec_status.ok()) {
820
47.0k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.0k
                                                       : Status::Cancelled("force close"));
822
47.0k
        } else {
823
87
            _writer->force_close(exec_status);
824
87
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
47.1k
        RETURN_IF_ERROR(st);
829
47.1k
    }
830
47.0k
    return Base::close(state, exec_status);
831
47.1k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
30
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
30
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
30
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
30
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
30
    if (_writer) {
818
30
        Status st = _writer->get_writer_status();
819
30
        if (exec_status.ok()) {
820
30
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
30
                                                       : Status::Cancelled("force close"));
822
30
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
30
        RETURN_IF_ERROR(st);
829
30
    }
830
30
    return Base::close(state, exec_status);
831
30
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
832
833
// An instantiation added outside the macros below needs the matching
834
// 'extern template' declaration in the operator's header (enforced by
835
// build-support/check-extern-template-pairing.py). Instantiations expanded
836
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
837
// skipped -- so their extern pairing has to be kept in sync by hand.
838
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
839
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
840
DECLARE_OPERATOR(ResultSinkLocalState)
841
DECLARE_OPERATOR(JdbcTableSinkLocalState)
842
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
843
DECLARE_OPERATOR(ResultFileSinkLocalState)
844
DECLARE_OPERATOR(OlapTableSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
846
DECLARE_OPERATOR(HiveTableSinkLocalState)
847
DECLARE_OPERATOR(TVFTableSinkLocalState)
848
DECLARE_OPERATOR(IcebergTableSinkLocalState)
849
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
850
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
851
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
852
DECLARE_OPERATOR(MCTableSinkLocalState)
853
DECLARE_OPERATOR(AnalyticSinkLocalState)
854
DECLARE_OPERATOR(BlackholeSinkLocalState)
855
DECLARE_OPERATOR(SortSinkLocalState)
856
DECLARE_OPERATOR(SpillSortSinkLocalState)
857
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
858
DECLARE_OPERATOR(AggSinkLocalState)
859
DECLARE_OPERATOR(BucketedAggSinkLocalState)
860
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
861
DECLARE_OPERATOR(ExchangeSinkLocalState)
862
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
863
DECLARE_OPERATOR(UnionSinkLocalState)
864
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
865
DECLARE_OPERATOR(PartitionSortSinkLocalState)
866
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
867
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
868
DECLARE_OPERATOR(SetSinkLocalState<true>)
869
DECLARE_OPERATOR(SetSinkLocalState<false>)
870
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
871
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
872
DECLARE_OPERATOR(CacheSinkLocalState)
873
DECLARE_OPERATOR(DictSinkLocalState)
874
DECLARE_OPERATOR(RecCTESinkLocalState)
875
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
876
877
#undef DECLARE_OPERATOR
878
879
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
880
DECLARE_OPERATOR(HashJoinProbeLocalState)
881
DECLARE_OPERATOR(OlapScanLocalState)
882
DECLARE_OPERATOR(GroupCommitLocalState)
883
DECLARE_OPERATOR(JDBCScanLocalState)
884
DECLARE_OPERATOR(FileScanLocalState)
885
DECLARE_OPERATOR(AnalyticLocalState)
886
DECLARE_OPERATOR(SortLocalState)
887
DECLARE_OPERATOR(SpillSortLocalState)
888
DECLARE_OPERATOR(LocalMergeSortLocalState)
889
DECLARE_OPERATOR(AggLocalState)
890
DECLARE_OPERATOR(BucketedAggLocalState)
891
DECLARE_OPERATOR(PartitionedAggLocalState)
892
DECLARE_OPERATOR(TableFunctionLocalState)
893
DECLARE_OPERATOR(ExchangeLocalState)
894
DECLARE_OPERATOR(RepeatLocalState)
895
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
896
DECLARE_OPERATOR(AssertNumRowsLocalState)
897
DECLARE_OPERATOR(EmptySetLocalState)
898
DECLARE_OPERATOR(UnionSourceLocalState)
899
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
900
DECLARE_OPERATOR(PartitionSortSourceLocalState)
901
DECLARE_OPERATOR(SetSourceLocalState<true>)
902
DECLARE_OPERATOR(SetSourceLocalState<false>)
903
DECLARE_OPERATOR(DataGenLocalState)
904
DECLARE_OPERATOR(SchemaScanLocalState)
905
DECLARE_OPERATOR(MetaScanLocalState)
906
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
907
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
908
DECLARE_OPERATOR(CacheSourceLocalState)
909
DECLARE_OPERATOR(RecCTESourceLocalState)
910
DECLARE_OPERATOR(RecCTEScanLocalState)
911
912
#ifdef BE_TEST
913
DECLARE_OPERATOR(MockLocalState)
914
DECLARE_OPERATOR(MockScanLocalState)
915
#endif
916
#undef DECLARE_OPERATOR
917
918
template class StreamingOperatorX<AssertNumRowsLocalState>;
919
template class StreamingOperatorX<SelectLocalState>;
920
921
template class StatefulOperatorX<HashJoinProbeLocalState>;
922
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
923
template class StatefulOperatorX<RepeatLocalState>;
924
template class StatefulOperatorX<MaterializationLocalState>;
925
template class StatefulOperatorX<StreamingAggLocalState>;
926
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
927
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
928
template class StatefulOperatorX<TableFunctionLocalState>;
929
930
template class PipelineXSinkLocalState<HashJoinSharedState>;
931
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
932
template class PipelineXSinkLocalState<SortSharedState>;
933
template class PipelineXSinkLocalState<SpillSortSharedState>;
934
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
935
template class PipelineXSinkLocalState<AnalyticSharedState>;
936
template class PipelineXSinkLocalState<AggSharedState>;
937
template class PipelineXSinkLocalState<BucketedAggSharedState>;
938
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
939
template class PipelineXSinkLocalState<FakeSharedState>;
940
template class PipelineXSinkLocalState<UnionSharedState>;
941
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
942
template class PipelineXSinkLocalState<MultiCastSharedState>;
943
template class PipelineXSinkLocalState<SetSharedState>;
944
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
945
template class PipelineXSinkLocalState<BasicSharedState>;
946
template class PipelineXSinkLocalState<DataQueueSharedState>;
947
template class PipelineXSinkLocalState<RecCTESharedState>;
948
949
template class PipelineXLocalState<HashJoinSharedState>;
950
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
951
template class PipelineXLocalState<SortSharedState>;
952
template class PipelineXLocalState<SpillSortSharedState>;
953
template class PipelineXLocalState<NestedLoopJoinSharedState>;
954
template class PipelineXLocalState<AnalyticSharedState>;
955
template class PipelineXLocalState<AggSharedState>;
956
template class PipelineXLocalState<BucketedAggSharedState>;
957
template class PipelineXLocalState<PartitionedAggSharedState>;
958
template class PipelineXLocalState<FakeSharedState>;
959
template class PipelineXLocalState<UnionSharedState>;
960
template class PipelineXLocalState<DataQueueSharedState>;
961
template class PipelineXLocalState<MultiCastSharedState>;
962
template class PipelineXLocalState<PartitionSortNodeSharedState>;
963
template class PipelineXLocalState<SetSharedState>;
964
template class PipelineXLocalState<LocalExchangeSharedState>;
965
template class PipelineXLocalState<BasicSharedState>;
966
template class PipelineXLocalState<RecCTESharedState>;
967
968
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
969
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
970
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
971
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
972
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
973
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
974
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
977
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
978
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
979
980
#ifdef BE_TEST
981
template class OperatorX<DummyOperatorLocalState>;
982
template class DataSinkOperatorX<DummySinkLocalState>;
983
#endif
984
985
} // namespace doris