Coverage Report

Created: 2026-09-18 10:56

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.76M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.76M
    if (_parent->nereids_id() == -1) {
122
910k
        return fmt::format("(id={})", _parent->node_id());
123
910k
    } else {
124
855k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
855k
    }
126
1.76M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
71.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
71.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
71.1k
    } else {
124
71.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
71.1k
    }
126
71.1k
}
_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
229k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
229k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
229k
    } else {
124
229k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
229k
    }
126
229k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
23
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
23
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
23
    } else {
124
23
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
23
    }
126
23
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.47k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.47k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
6.47k
    } else {
124
6.47k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.47k
    }
126
6.47k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.34k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.34k
    if (_parent->nereids_id() == -1) {
122
14
        return fmt::format("(id={})", _parent->node_id());
123
8.33k
    } else {
124
8.33k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.33k
    }
126
8.34k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
88.5k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
88.5k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
88.4k
    } else {
124
88.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
88.4k
    }
126
88.5k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
38.5k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
38.5k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
38.5k
    } else {
124
38.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
38.5k
    }
126
38.5k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
119
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
119
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
119
    } else {
124
119
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
119
    }
126
119
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
645k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
645k
    if (_parent->nereids_id() == -1) {
122
292k
        return fmt::format("(id={})", _parent->node_id());
123
353k
    } else {
124
353k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
353k
    }
126
645k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.1k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.1k
    } else {
124
54.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.1k
    }
126
54.1k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.25k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.26k
    if (_parent->nereids_id() == -1) {
122
5.26k
        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
5.25k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
465
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
465
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
363
    } else {
124
363
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
363
    }
126
465
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.15k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.15k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.14k
    } else {
124
5.14k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.14k
    }
126
5.15k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
612k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
613k
    if (_parent->nereids_id() == -1) {
122
613k
        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
612k
}
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.13M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.13M
    if (_parent->nereids_id() == -1) {
131
633k
        return fmt::format("(id={})", _parent->node_id());
132
633k
    } else {
133
503k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
503k
    }
135
1.13M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
119k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
119k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
119k
    } else {
133
119k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
119k
    }
135
119k
}
_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
233k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
233k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
233k
    } else {
133
233k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
233k
    }
135
233k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
29
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
29
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
29
    } else {
133
29
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
29
    }
135
29
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
6.49k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6.49k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
6.49k
    } else {
133
6.49k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
6.49k
    }
135
6.49k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.36k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.36k
    if (_parent->nereids_id() == -1) {
131
14
        return fmt::format("(id={})", _parent->node_id());
132
8.34k
    } else {
133
8.34k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.34k
    }
135
8.36k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
89.2k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
89.2k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
89.2k
    } else {
133
89.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
89.2k
    }
135
89.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
38.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
38.4k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
38.4k
    } else {
133
38.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
38.4k
    }
135
38.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
129
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
129
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
129
    } else {
133
129
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
129
    }
135
129
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
15
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
15
    if (_parent->nereids_id() == -1) {
131
15
        return fmt::format("(id={})", _parent->node_id());
132
15
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
15
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.32k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.32k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
8.32k
    } else {
133
8.32k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.32k
    }
135
8.32k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
465
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
465
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
363
    } else {
133
363
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
363
    }
135
465
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.9k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
13.0k
    if (_parent->nereids_id() == -1) {
131
13.0k
        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.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
218k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
219k
    if (_parent->nereids_id() == -1) {
131
219k
        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
218k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
400k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
400k
    if (_parent->nereids_id() == -1) {
131
400k
        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
400k
}
_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
29.5k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.5k
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
29.5k
    _terminated = true;
143
29.5k
    return Status::OK();
144
29.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.62k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.62k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.62k
    _terminated = true;
143
1.62k
    return Status::OK();
144
1.62k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_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_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.47k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.47k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.47k
    _terminated = true;
143
1.47k
    return Status::OK();
144
1.47k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
716
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
716
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
716
    _terminated = true;
143
716
    return Status::OK();
144
716
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_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_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
861
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
861
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
860
    _terminated = true;
143
860
    return Status::OK();
144
861
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
189
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
189
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
189
    _terminated = true;
143
189
    return Status::OK();
144
189
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
4
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
4
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
4
    _terminated = true;
143
4
    return Status::OK();
144
4
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
142
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
142
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
142
    _terminated = true;
143
142
    return Status::OK();
144
142
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_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_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
304
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
304
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
304
    _terminated = true;
143
304
    return Status::OK();
144
304
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
128
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
128
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
128
    _terminated = true;
143
128
    return Status::OK();
144
128
}
145
146
311k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
311k
    return _child && _child->is_serial_operator() && !is_source()
148
311k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
311k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
311k
}
151
152
26.7k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
26.7k
    if (!_child) {
154
25.5k
        return false;
155
25.5k
    }
156
1.25k
    if (_child->is_serial_operator()) {
157
180
        return true;
158
180
    }
159
1.07k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.07k
    return child_distribution.need_local_exchange() &&
161
1.07k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.25k
}
163
164
template <typename SharedStateArg>
165
16.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.5k
    fmt::memory_buffer debug_string_buffer;
167
16.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.5k
    return fmt::to_string(debug_string_buffer);
169
16.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
16.4k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.4k
    fmt::memory_buffer debug_string_buffer;
167
16.4k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.4k
    return fmt::to_string(debug_string_buffer);
169
16.4k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
16.4k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.4k
    fmt::memory_buffer debug_string_buffer;
174
16.4k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.4k
    return fmt::to_string(debug_string_buffer);
176
16.4k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
16.4k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.4k
    fmt::memory_buffer debug_string_buffer;
174
16.4k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.4k
    return fmt::to_string(debug_string_buffer);
176
16.4k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
16.5k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
16.5k
    fmt::memory_buffer debug_string_buffer;
180
16.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
16.5k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
16.5k
                   _is_serial_operator);
183
16.5k
    return fmt::to_string(debug_string_buffer);
184
16.5k
}
185
186
16.4k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
16.4k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
16.4k
}
189
190
664k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
664k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
664k
    _nereids_id = tnode.nereids_id;
193
664k
    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
664k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
664k
    _op_name = substr + "_OPERATOR";
208
209
664k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
664k
    } else if (tnode.__isset.conjuncts) {
212
272k
        for (const auto& conjunct : tnode.conjuncts) {
213
272k
            VExprContextSPtr context;
214
272k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
272k
            _conjuncts.emplace_back(context);
216
272k
        }
217
98.9k
    }
218
219
    // create the projections expr
220
664k
    if (tnode.__isset.projections) {
221
260k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
260k
    }
223
664k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.87k
        DCHECK(has_projection()) << "no final projections";
225
3.87k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.54k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.54k
            VExprContextSPtrs projections;
228
6.54k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.54k
            _projection->intermediate_projections.push_back(projections);
230
6.54k
        }
231
3.87k
    }
232
664k
    return Status::OK();
233
664k
}
234
235
691k
Status OperatorXBase::prepare(RuntimeState* state) {
236
691k
    for (auto& conjunct : _conjuncts) {
237
272k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
272k
    }
239
691k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
640k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
339k
            return a->execute_cost() < b->execute_cost();
242
339k
        });
243
640k
    };
244
245
691k
    if (has_projection()) {
246
259k
        auto& projection = *_projection;
247
266k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.54k
            const auto& input_row_desc =
249
6.54k
                    i == 0 ? operator_row_desc_before_projection()
250
6.54k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.54k
            RETURN_IF_ERROR(
252
6.54k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.54k
        }
254
259k
        const auto& final_projection_input_row_desc =
255
259k
                projection.intermediate_output_row_descriptors.empty()
256
259k
                        ? operator_row_desc_before_projection()
257
259k
                        : projection.intermediate_output_row_descriptors.back();
258
259k
        RETURN_IF_ERROR(
259
259k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
259k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
259k
                                                      projection.output_row_descriptor));
262
259k
    }
263
264
691k
    for (auto& conjunct : _conjuncts) {
265
272k
        RETURN_IF_ERROR(conjunct->open(state));
266
272k
    }
267
691k
    if (has_projection()) {
268
259k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
259k
        for (auto& projections : _projection->intermediate_projections) {
270
6.53k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.53k
        }
272
259k
    }
273
691k
    if (_child && !is_source()) {
274
105k
        RETURN_IF_ERROR(_child->prepare(state));
275
105k
    }
276
277
691k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
691k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
691k
    return Status::OK();
283
691k
}
284
285
6.04k
Status OperatorXBase::terminate(RuntimeState* state) {
286
6.04k
    if (_child && !is_source()) {
287
552
        RETURN_IF_ERROR(_child->terminate(state));
288
552
    }
289
6.04k
    auto result = state->get_local_state_result(operator_id());
290
6.04k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
6.04k
    return result.value()->terminate(state);
294
6.04k
}
295
296
4.86M
Status OperatorXBase::close(RuntimeState* state) {
297
4.86M
    if (_child && !is_source()) {
298
851k
        RETURN_IF_ERROR(_child->close(state));
299
851k
    }
300
4.86M
    auto result = state->get_local_state_result(operator_id());
301
4.86M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.86M
    return result.value()->close(state);
305
4.86M
}
306
307
284k
void PipelineXLocalStateBase::clear_origin_block() {
308
284k
    _origin_block.clear_column_data(
309
284k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
284k
}
311
312
542k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
542k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
542k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
542k
    return Status::OK();
317
542k
}
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
284k
                                     Block* output_block) const {
326
284k
    auto* local_state = state->get_local_state(operator_id());
327
284k
    SCOPED_TIMER(local_state->exec_time_counter());
328
284k
    SCOPED_TIMER(local_state->_projection_timer);
329
284k
    const size_t rows = origin_block->rows();
330
284k
    if (rows == 0) {
331
147k
        return Status::OK();
332
147k
    }
333
136k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
136k
    {
336
136k
        Block input_block = *origin_block;
337
338
136k
        ColumnsWithTypeAndName new_columns;
339
136k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.56k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.56k
            new_columns.resize(projections.size());
345
69.7k
            for (int i = 0; i < projections.size(); i++) {
346
66.1k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
66.1k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
66.1k
            }
355
3.55k
            Block tmp_block {new_columns};
356
3.55k
            input_block.swap(tmp_block);
357
3.55k
        }
358
359
136k
        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
136k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
136k
                output_block, _projection->output_row_descriptor);
368
136k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
136k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
136k
        Columns shared_columns(mutable_columns.size());
371
372
771k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
634k
            ColumnPtr column_ptr;
374
634k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
634k
            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
634k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
634k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
634k
            if (column_ptr->is_exclusive()) {
386
226k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
408k
            } else {
388
408k
                shared_columns[i] = std::move(column_ptr);
389
408k
            }
390
634k
        }
391
392
136k
        scoped_mutable_block.restore();
393
771k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
634k
            if (shared_columns[i]) {
395
408k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
408k
            }
397
634k
        }
398
136k
    }
399
400
0
    origin_block->clear_column_data(
401
136k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
136k
    DCHECK_EQ(output_block->rows(), rows);
403
404
136k
    return Status::OK();
405
136k
}
406
407
3.93M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
3.93M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
3.93M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
3.93M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
3.93M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
3.93M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
3.93M
            if (_debug_point_count++ % 2 == 0) {
414
3.93M
                return Status::OK();
415
3.93M
            }
416
3.93M
        }
417
3.93M
    });
418
419
3.93M
    Status status;
420
3.93M
    auto* local_state = state->get_local_state(operator_id());
421
3.93M
    Defer defer([&]() {
422
3.93M
        if (status.ok()) {
423
3.93M
            local_state->update_output_block_counters(*block);
424
3.93M
        }
425
3.93M
    });
426
3.93M
    if (has_projection()) {
427
284k
        local_state->clear_origin_block();
428
284k
        status = get_block(state, &local_state->_origin_block, eos);
429
284k
        if (UNLIKELY(!status.ok())) {
430
24
            return status;
431
24
        }
432
284k
        status = do_projections(state, &local_state->_origin_block, block);
433
284k
        return status;
434
284k
    }
435
3.65M
    status = get_block(state, block, eos);
436
3.65M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.65M
    return status;
438
3.65M
}
439
440
2.52M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.52M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.43k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.43k
        *eos = true;
444
9.43k
    }
445
446
2.52M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.52M
        auto op_name = to_lower(_parent->_op_name);
448
2.52M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.52M
        arg_op_name = to_lower(arg_op_name);
450
451
2.52M
        if (op_name == arg_op_name) {
452
2.52M
            *eos = true;
453
2.52M
        }
454
2.52M
    });
455
456
2.52M
    if (auto rows = block->rows()) {
457
728k
        _num_rows_returned += rows;
458
728k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
728k
    }
460
2.52M
}
461
462
29.4k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
29.4k
    auto result = state->get_sink_local_state_result();
464
29.4k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
29.4k
    return result.value()->terminate(state);
468
29.4k
}
469
470
16.5k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
16.5k
    fmt::memory_buffer debug_string_buffer;
472
473
16.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
16.5k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
16.5k
    return fmt::to_string(debug_string_buffer);
476
16.5k
}
477
478
16.4k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
16.4k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
16.4k
}
481
482
344k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
344k
    std::string op_name = "UNKNOWN_SINK";
484
344k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
345k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
345k
        op_name = it->second;
488
345k
    }
489
344k
    _name = op_name + "_OPERATOR";
490
344k
    return Status::OK();
491
344k
}
492
493
288k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
288k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
288k
    _nereids_id = tnode.nereids_id;
496
288k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
288k
    _name = substr + "_SINK_OPERATOR";
498
288k
    return Status::OK();
499
288k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.67M
                                                            LocalSinkStateInfo& info) {
504
1.67M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.67M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.67M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.67M
    return Status::OK();
508
1.67M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
119k
                                                            LocalSinkStateInfo& info) {
504
119k
    auto local_state = LocalStateType::create_unique(this, state);
505
119k
    RETURN_IF_ERROR(local_state->init(state, info));
506
119k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
119k
    return Status::OK();
508
119k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
354k
                                                            LocalSinkStateInfo& info) {
504
354k
    auto local_state = LocalStateType::create_unique(this, state);
505
354k
    RETURN_IF_ERROR(local_state->init(state, info));
506
354k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
354k
    return Status::OK();
508
354k
}
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
354
                                                            LocalSinkStateInfo& info) {
504
354
    auto local_state = LocalStateType::create_unique(this, state);
505
354
    RETURN_IF_ERROR(local_state->init(state, info));
506
354
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
354
    return Status::OK();
508
354
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
46.5k
                                                            LocalSinkStateInfo& info) {
504
46.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
46.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
46.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
46.5k
    return Status::OK();
508
46.5k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
27
                                                            LocalSinkStateInfo& info) {
504
27
    auto local_state = LocalStateType::create_unique(this, state);
505
27
    RETURN_IF_ERROR(local_state->init(state, info));
506
27
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
27
    return Status::OK();
508
27
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.36k
                                                            LocalSinkStateInfo& info) {
504
8.36k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.36k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.36k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.36k
    return Status::OK();
508
8.36k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
12
                                                            LocalSinkStateInfo& info) {
504
12
    auto local_state = LocalStateType::create_unique(this, state);
505
12
    RETURN_IF_ERROR(local_state->init(state, info));
506
12
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
12
    return Status::OK();
508
12
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
233k
                                                            LocalSinkStateInfo& info) {
504
233k
    auto local_state = LocalStateType::create_unique(this, state);
505
233k
    RETURN_IF_ERROR(local_state->init(state, info));
506
233k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
233k
    return Status::OK();
508
233k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
29
                                                            LocalSinkStateInfo& info) {
504
29
    auto local_state = LocalStateType::create_unique(this, state);
505
29
    RETURN_IF_ERROR(local_state->init(state, info));
506
29
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
29
    return Status::OK();
508
29
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
219k
                                                            LocalSinkStateInfo& info) {
504
219k
    auto local_state = LocalStateType::create_unique(this, state);
505
219k
    RETURN_IF_ERROR(local_state->init(state, info));
506
219k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
219k
    return Status::OK();
508
219k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
89.5k
                                                            LocalSinkStateInfo& info) {
504
89.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
89.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
89.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
89.5k
    return Status::OK();
508
89.5k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
38.5k
                                                            LocalSinkStateInfo& info) {
504
38.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
38.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
38.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
38.5k
    return Status::OK();
508
38.5k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
129
                                                            LocalSinkStateInfo& info) {
504
129
    auto local_state = LocalStateType::create_unique(this, state);
505
129
    RETURN_IF_ERROR(local_state->init(state, info));
506
129
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
129
    return Status::OK();
508
129
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
535k
                                                            LocalSinkStateInfo& info) {
504
535k
    auto local_state = LocalStateType::create_unique(this, state);
505
535k
    RETURN_IF_ERROR(local_state->init(state, info));
506
535k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
535k
    return Status::OK();
508
535k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.50k
                                                            LocalSinkStateInfo& info) {
504
6.50k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.50k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.50k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.50k
    return Status::OK();
508
6.50k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.32k
                                                            LocalSinkStateInfo& info) {
504
8.32k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.32k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.32k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.32k
    return Status::OK();
508
8.32k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.16k
                                                            LocalSinkStateInfo& info) {
504
2.16k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.16k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.16k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.16k
    return Status::OK();
508
2.16k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
363
                                                            LocalSinkStateInfo& info) {
504
363
    auto local_state = LocalStateType::create_unique(this, state);
505
363
    RETURN_IF_ERROR(local_state->init(state, info));
506
363
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
363
    return Status::OK();
508
363
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.93k
                                                            LocalSinkStateInfo& info) {
504
4.93k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.93k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.93k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.93k
    return Status::OK();
508
4.93k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.73k
                                                            LocalSinkStateInfo& info) {
504
2.73k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.73k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.73k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.73k
    return Status::OK();
508
2.73k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.65k
                                                            LocalSinkStateInfo& info) {
504
2.65k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.65k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.65k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.65k
    return Status::OK();
508
2.65k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.56k
                                                            LocalSinkStateInfo& info) {
504
2.56k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.56k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.56k
    return Status::OK();
508
2.56k
}
_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
562
                                                            LocalSinkStateInfo& info) {
504
562
    auto local_state = LocalStateType::create_unique(this, state);
505
562
    RETURN_IF_ERROR(local_state->init(state, info));
506
562
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
562
    return Status::OK();
508
562
}
_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
105
                                                            LocalSinkStateInfo& info) {
504
105
    auto local_state = LocalStateType::create_unique(this, state);
505
105
    RETURN_IF_ERROR(local_state->init(state, info));
506
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
105
    return Status::OK();
508
105
}
_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.38M
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.38M
    } else {
519
1.38M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.38M
        ss->id = operator_id();
521
1.38M
        for (auto& dest : dests_id()) {
522
1.37M
            ss->related_op_ids.insert(dest);
523
1.37M
        }
524
1.38M
        return ss;
525
1.38M
    }
526
1.38M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
100k
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
100k
    } else {
519
100k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
100k
        ss->id = operator_id();
521
100k
        for (auto& dest : dests_id()) {
522
100k
            ss->related_op_ids.insert(dest);
523
100k
        }
524
100k
        return ss;
525
100k
    }
526
100k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
355k
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
355k
    } else {
519
355k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
355k
        ss->id = operator_id();
521
355k
        for (auto& dest : dests_id()) {
522
352k
            ss->related_op_ids.insert(dest);
523
352k
        }
524
355k
        return ss;
525
355k
    }
526
355k
}
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
357
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
357
    } else {
519
357
        auto ss = LocalStateType::SharedStateType::create_shared();
520
357
        ss->id = operator_id();
521
357
        for (auto& dest : dests_id()) {
522
356
            ss->related_op_ids.insert(dest);
523
356
        }
524
357
        return ss;
525
357
    }
526
357
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46.5k
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.5k
    } else {
519
46.5k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46.5k
        ss->id = operator_id();
521
46.5k
        for (auto& dest : dests_id()) {
522
46.2k
            ss->related_op_ids.insert(dest);
523
46.2k
        }
524
46.5k
        return ss;
525
46.5k
    }
526
46.5k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
27
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
27
    } else {
519
27
        auto ss = LocalStateType::SharedStateType::create_shared();
520
27
        ss->id = operator_id();
521
27
        for (auto& dest : dests_id()) {
522
27
            ss->related_op_ids.insert(dest);
523
27
        }
524
27
        return ss;
525
27
    }
526
27
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
8.43k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8.43k
    } else {
519
8.43k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.43k
        ss->id = operator_id();
521
8.45k
        for (auto& dest : dests_id()) {
522
8.45k
            ss->related_op_ids.insert(dest);
523
8.45k
        }
524
8.43k
        return ss;
525
8.43k
    }
526
8.43k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
12
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
12
    } else {
519
12
        auto ss = LocalStateType::SharedStateType::create_shared();
520
12
        ss->id = operator_id();
521
12
        for (auto& dest : dests_id()) {
522
12
            ss->related_op_ids.insert(dest);
523
12
        }
524
12
        return ss;
525
12
    }
526
12
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
234k
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
234k
    } else {
519
234k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
234k
        ss->id = operator_id();
521
234k
        for (auto& dest : dests_id()) {
522
234k
            ss->related_op_ids.insert(dest);
523
234k
        }
524
234k
        return ss;
525
234k
    }
526
234k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
32
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
32
    } else {
519
32
        auto ss = LocalStateType::SharedStateType::create_shared();
520
32
        ss->id = operator_id();
521
32
        for (auto& dest : dests_id()) {
522
32
            ss->related_op_ids.insert(dest);
523
32
        }
524
32
        return ss;
525
32
    }
526
32
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
89.8k
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.8k
    } else {
519
89.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
89.8k
        ss->id = operator_id();
521
89.8k
        for (auto& dest : dests_id()) {
522
89.8k
            ss->related_op_ids.insert(dest);
523
89.8k
        }
524
89.8k
        return ss;
525
89.8k
    }
526
89.8k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
127
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
127
    } else {
519
127
        auto ss = LocalStateType::SharedStateType::create_shared();
520
127
        ss->id = operator_id();
521
127
        for (auto& dest : dests_id()) {
522
127
            ss->related_op_ids.insert(dest);
523
127
        }
524
127
        return ss;
525
127
    }
526
127
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
535k
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
535k
    } else {
519
535k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
535k
        ss->id = operator_id();
521
535k
        for (auto& dest : dests_id()) {
522
529k
            ss->related_op_ids.insert(dest);
523
529k
        }
524
535k
        return ss;
525
535k
    }
526
535k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.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
6.51k
    } else {
519
6.51k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.51k
        ss->id = operator_id();
521
6.51k
        for (auto& dest : dests_id()) {
522
6.50k
            ss->related_op_ids.insert(dest);
523
6.50k
        }
524
6.51k
        return ss;
525
6.51k
    }
526
6.51k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
467
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
467
    } else {
519
467
        auto ss = LocalStateType::SharedStateType::create_shared();
520
467
        ss->id = operator_id();
521
467
        for (auto& dest : dests_id()) {
522
466
            ss->related_op_ids.insert(dest);
523
466
        }
524
467
        return ss;
525
467
    }
526
467
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.65k
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.65k
    } else {
519
2.65k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.65k
        ss->id = operator_id();
521
2.67k
        for (auto& dest : dests_id()) {
522
2.67k
            ss->related_op_ids.insert(dest);
523
2.67k
        }
524
2.65k
        return ss;
525
2.65k
    }
526
2.65k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.57k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.57k
    } else {
519
2.57k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.57k
        ss->id = operator_id();
521
2.57k
        for (auto& dest : dests_id()) {
522
2.57k
            ss->related_op_ids.insert(dest);
523
2.57k
        }
524
2.57k
        return ss;
525
2.57k
    }
526
2.57k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
556
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
556
    } else {
519
556
        auto ss = LocalStateType::SharedStateType::create_shared();
520
556
        ss->id = operator_id();
521
556
        for (auto& dest : dests_id()) {
522
552
            ss->related_op_ids.insert(dest);
523
552
        }
524
556
        return ss;
525
556
    }
526
556
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
105
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
105
    } else {
519
105
        auto ss = LocalStateType::SharedStateType::create_shared();
520
105
        ss->id = operator_id();
521
105
        for (auto& dest : dests_id()) {
522
105
            ss->related_op_ids.insert(dest);
523
105
        }
524
105
        return ss;
525
105
    }
526
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
2.02M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.02M
    auto local_state = LocalStateType::create_unique(state, this);
531
2.02M
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.02M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.02M
    return Status::OK();
534
2.02M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
71.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
71.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
71.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
71.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
71.3k
    return Status::OK();
534
71.3k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
237k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
237k
    auto local_state = LocalStateType::create_unique(state, this);
531
237k
    RETURN_IF_ERROR(local_state->init(state, info));
532
237k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
237k
    return Status::OK();
534
237k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
139
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
139
    auto local_state = LocalStateType::create_unique(state, this);
531
139
    RETURN_IF_ERROR(local_state->init(state, info));
532
139
    state->emplace_local_state(operator_id(), std::move(local_state));
533
139
    return Status::OK();
534
139
}
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
8.35k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.35k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.35k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.35k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.35k
    return Status::OK();
534
8.35k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.18k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.18k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.18k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.18k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.18k
    return Status::OK();
534
8.18k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
23
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
23
    auto local_state = LocalStateType::create_unique(state, this);
531
23
    RETURN_IF_ERROR(local_state->init(state, info));
532
23
    state->emplace_local_state(operator_id(), std::move(local_state));
533
23
    return Status::OK();
534
23
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
224k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
224k
    auto local_state = LocalStateType::create_unique(state, this);
531
224k
    RETURN_IF_ERROR(local_state->init(state, info));
532
224k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
224k
    return Status::OK();
534
224k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
89.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
89.2k
    auto local_state = LocalStateType::create_unique(state, this);
531
89.2k
    RETURN_IF_ERROR(local_state->init(state, info));
532
89.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
89.2k
    return Status::OK();
534
89.2k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
38.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
38.6k
    auto local_state = LocalStateType::create_unique(state, this);
531
38.6k
    RETURN_IF_ERROR(local_state->init(state, info));
532
38.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
38.6k
    return Status::OK();
534
38.6k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
119
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
119
    auto local_state = LocalStateType::create_unique(state, this);
531
119
    RETURN_IF_ERROR(local_state->init(state, info));
532
119
    state->emplace_local_state(operator_id(), std::move(local_state));
533
119
    return Status::OK();
534
119
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.78k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.78k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.78k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.78k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.78k
    return Status::OK();
534
3.78k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
294k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
294k
    auto local_state = LocalStateType::create_unique(state, this);
531
294k
    RETURN_IF_ERROR(local_state->init(state, info));
532
294k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
294k
    return Status::OK();
534
294k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.22k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.22k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.22k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.22k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.22k
    return Status::OK();
534
1.22k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.49k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.49k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.49k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.49k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.49k
    return Status::OK();
534
6.49k
}
_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.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.3k
    return Status::OK();
534
54.3k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.26k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.26k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.26k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.26k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.26k
    return Status::OK();
534
5.26k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
362
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
362
    auto local_state = LocalStateType::create_unique(state, this);
531
362
    RETURN_IF_ERROR(local_state->init(state, info));
532
362
    state->emplace_local_state(operator_id(), std::move(local_state));
533
362
    return Status::OK();
534
362
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.63k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.63k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.63k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.63k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.63k
    return Status::OK();
534
2.63k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.53k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.53k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.53k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.53k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.53k
    return Status::OK();
534
2.53k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
348
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
348
    auto local_state = LocalStateType::create_unique(state, this);
531
348
    RETURN_IF_ERROR(local_state->init(state, info));
532
348
    state->emplace_local_state(operator_id(), std::move(local_state));
533
348
    return Status::OK();
534
348
}
_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.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.2k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.2k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.2k
    return Status::OK();
534
10.2k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
619k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
619k
    auto local_state = LocalStateType::create_unique(state, this);
531
619k
    RETURN_IF_ERROR(local_state->init(state, info));
532
619k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
619k
    return Status::OK();
534
619k
}
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
783
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
783
    auto local_state = LocalStateType::create_unique(state, this);
531
783
    RETURN_IF_ERROR(local_state->init(state, info));
532
783
    state->emplace_local_state(operator_id(), std::move(local_state));
533
783
    return Status::OK();
534
783
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.11k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.11k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.11k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.11k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.11k
    return Status::OK();
534
1.11k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.10k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.10k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.10k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.10k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.10k
    return Status::OK();
534
6.10k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
329k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
329k
    auto local_state = LocalStateType::create_unique(state, this);
531
329k
    RETURN_IF_ERROR(local_state->init(state, info));
532
329k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
329k
    return Status::OK();
534
329k
}
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.01M
        : _num_rows_returned(0),
542
2.01M
          _rows_returned_counter(nullptr),
543
2.01M
          _parent(parent),
544
2.01M
          _state(state),
545
2.01M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
2.02M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
2.02M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
2.02M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
2.02M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
2.02M
    _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.02M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
2.02M
    _operator_profile->add_child(_common_profile.get(), true);
557
2.02M
    _operator_profile->add_child(_custom_profile.get(), true);
558
2.02M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
2.02M
    if constexpr (!is_fake_shared) {
560
1.13M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
669k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
669k
                                    .first.get()
563
669k
                                    ->template cast<SharedStateArg>();
564
565
669k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
669k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
669k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
669k
        } else if (info.shared_state) {
569
395k
            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
395k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
395k
            _dependency = _shared_state->create_source_dependency(
576
395k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
395k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
395k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
395k
        } else {
580
71.4k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
10.4k
                DCHECK(false);
582
10.4k
            }
583
71.4k
        }
584
1.13M
    }
585
586
2.02M
    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.02M
    _rows_returned_counter =
591
2.02M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
2.02M
    _blocks_returned_counter =
593
2.02M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
2.02M
    _output_block_bytes_counter =
595
2.02M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
2.02M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
2.02M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
2.02M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
2.02M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
2.02M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
2.02M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
2.02M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
2.02M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
2.02M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
2.02M
    _memory_used_counter =
606
2.02M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
2.02M
    _common_profile->add_info_string("IsColocate",
608
2.02M
                                     std::to_string(_parent->is_colocated_operator()));
609
2.02M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
2.02M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
2.02M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
2.02M
    return Status::OK();
613
2.02M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
71.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
71.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
71.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
71.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
71.6k
    _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
71.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
71.6k
    _operator_profile->add_child(_common_profile.get(), true);
557
71.6k
    _operator_profile->add_child(_custom_profile.get(), true);
558
71.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
71.6k
    if constexpr (!is_fake_shared) {
560
71.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
18.5k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
18.5k
                                    .first.get()
563
18.5k
                                    ->template cast<SharedStateArg>();
564
565
18.5k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
18.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
18.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
53.0k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
52.2k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
52.2k
            _dependency = _shared_state->create_source_dependency(
576
52.2k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
52.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
52.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
52.2k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
796
        }
584
71.6k
    }
585
586
71.6k
    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
71.6k
    _rows_returned_counter =
591
71.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
71.6k
    _blocks_returned_counter =
593
71.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
71.6k
    _output_block_bytes_counter =
595
71.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
71.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
71.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
71.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
71.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
71.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
71.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
71.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
71.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
71.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
71.6k
    _memory_used_counter =
606
71.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
71.6k
    _common_profile->add_info_string("IsColocate",
608
71.6k
                                     std::to_string(_parent->is_colocated_operator()));
609
71.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
71.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
71.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
71.6k
    return Status::OK();
613
71.6k
}
_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
233k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
233k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
233k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
233k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
233k
    _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
233k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
233k
    _operator_profile->add_child(_common_profile.get(), true);
557
233k
    _operator_profile->add_child(_custom_profile.get(), true);
558
233k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
233k
    if constexpr (!is_fake_shared) {
560
233k
        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
233k
        } 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
225k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
225k
            _dependency = _shared_state->create_source_dependency(
576
225k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
225k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
225k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
225k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
7.88k
        }
584
233k
    }
585
586
233k
    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
233k
    _rows_returned_counter =
591
233k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
233k
    _blocks_returned_counter =
593
233k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
233k
    _output_block_bytes_counter =
595
233k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
233k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
233k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
233k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
233k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
233k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
233k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
233k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
233k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
233k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
233k
    _memory_used_counter =
606
233k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
233k
    _common_profile->add_info_string("IsColocate",
608
233k
                                     std::to_string(_parent->is_colocated_operator()));
609
233k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
233k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
233k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
233k
    return Status::OK();
613
233k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
23
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
23
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
23
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
23
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
23
    _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
23
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
23
    _operator_profile->add_child(_common_profile.get(), true);
557
23
    _operator_profile->add_child(_custom_profile.get(), true);
558
23
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
23
    if constexpr (!is_fake_shared) {
560
23
        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
23
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
22
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
22
            _dependency = _shared_state->create_source_dependency(
576
22
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
22
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
22
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
22
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
23
    }
585
586
23
    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
23
    _rows_returned_counter =
591
23
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
23
    _blocks_returned_counter =
593
23
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
23
    _output_block_bytes_counter =
595
23
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
23
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
23
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
23
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
23
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
23
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
23
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
23
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
23
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
23
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
23
    _memory_used_counter =
606
23
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
23
    _common_profile->add_info_string("IsColocate",
608
23
                                     std::to_string(_parent->is_colocated_operator()));
609
23
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
23
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
23
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
23
    return Status::OK();
613
23
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.50k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.50k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.50k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.50k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.50k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.50k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.50k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.50k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.50k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.50k
    if constexpr (!is_fake_shared) {
560
6.50k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.50k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.45k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.45k
            _dependency = _shared_state->create_source_dependency(
576
6.45k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.45k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.45k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.45k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
47
        }
584
6.50k
    }
585
586
6.50k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.50k
    _rows_returned_counter =
591
6.50k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.50k
    _blocks_returned_counter =
593
6.50k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.50k
    _output_block_bytes_counter =
595
6.50k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.50k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.50k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.50k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.50k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.50k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.50k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.50k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.50k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.50k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.50k
    _memory_used_counter =
606
6.50k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.50k
    _common_profile->add_info_string("IsColocate",
608
6.50k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.50k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.50k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.50k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.50k
    return Status::OK();
613
6.50k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.44k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.44k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.44k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.44k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.44k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
8.44k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.44k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.44k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.44k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.44k
    if constexpr (!is_fake_shared) {
560
8.44k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
8.44k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
8.31k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.31k
            _dependency = _shared_state->create_source_dependency(
576
8.31k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.31k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.31k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.31k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
125
        }
584
8.44k
    }
585
586
8.44k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
8.44k
    _rows_returned_counter =
591
8.44k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.44k
    _blocks_returned_counter =
593
8.44k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.44k
    _output_block_bytes_counter =
595
8.44k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.44k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.44k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.44k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.44k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.44k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.44k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.44k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.44k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.44k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.44k
    _memory_used_counter =
606
8.44k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.44k
    _common_profile->add_info_string("IsColocate",
608
8.44k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.44k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.44k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.44k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.44k
    return Status::OK();
613
8.44k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
89.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
89.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
89.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
89.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
89.4k
    _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.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
89.4k
    _operator_profile->add_child(_common_profile.get(), true);
557
89.4k
    _operator_profile->add_child(_custom_profile.get(), true);
558
89.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
89.4k
    if constexpr (!is_fake_shared) {
560
89.4k
        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.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
88.1k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
88.1k
            _dependency = _shared_state->create_source_dependency(
576
88.1k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
88.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
88.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
88.1k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.36k
        }
584
89.4k
    }
585
586
89.4k
    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.4k
    _rows_returned_counter =
591
89.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
89.4k
    _blocks_returned_counter =
593
89.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
89.4k
    _output_block_bytes_counter =
595
89.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
89.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
89.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
89.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
89.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
89.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
89.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
89.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
89.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
89.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
89.4k
    _memory_used_counter =
606
89.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
89.4k
    _common_profile->add_info_string("IsColocate",
608
89.4k
                                     std::to_string(_parent->is_colocated_operator()));
609
89.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
89.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
89.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
89.4k
    return Status::OK();
613
89.4k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
38.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
38.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
38.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
38.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
38.6k
    _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
38.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
38.6k
    _operator_profile->add_child(_common_profile.get(), true);
557
38.6k
    _operator_profile->add_child(_custom_profile.get(), true);
558
38.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
38.6k
    if constexpr (!is_fake_shared) {
560
38.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
38.5k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
38.5k
                                    .first.get()
563
38.5k
                                    ->template cast<SharedStateArg>();
564
565
38.5k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
38.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
38.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
38.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
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
90
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
90
        }
584
38.6k
    }
585
586
38.6k
    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
38.6k
    _rows_returned_counter =
591
38.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
38.6k
    _blocks_returned_counter =
593
38.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
38.6k
    _output_block_bytes_counter =
595
38.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
38.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
38.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
38.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
38.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
38.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
38.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
38.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
38.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
38.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
38.6k
    _memory_used_counter =
606
38.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
38.6k
    _common_profile->add_info_string("IsColocate",
608
38.6k
                                     std::to_string(_parent->is_colocated_operator()));
609
38.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
38.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
38.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
38.6k
    return Status::OK();
613
38.6k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
119
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
119
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
119
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
119
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
119
    _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
119
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
119
    _operator_profile->add_child(_common_profile.get(), true);
557
119
    _operator_profile->add_child(_custom_profile.get(), true);
558
119
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
119
    if constexpr (!is_fake_shared) {
560
119
        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
119
        } 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
119
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
119
            _dependency = _shared_state->create_source_dependency(
576
119
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
119
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
119
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
119
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
119
    }
585
586
119
    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
119
    _rows_returned_counter =
591
119
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
119
    _blocks_returned_counter =
593
119
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
119
    _output_block_bytes_counter =
595
119
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
119
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
119
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
119
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
119
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
119
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
119
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
119
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
119
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
119
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
119
    _memory_used_counter =
606
119
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
119
    _common_profile->add_info_string("IsColocate",
608
119
                                     std::to_string(_parent->is_colocated_operator()));
609
119
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
119
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
119
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
119
    return Status::OK();
613
119
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
890k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
890k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
890k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
890k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
890k
    _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
890k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
890k
    _operator_profile->add_child(_common_profile.get(), true);
557
890k
    _operator_profile->add_child(_custom_profile.get(), true);
558
890k
    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
890k
    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
890k
    _rows_returned_counter =
591
890k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
890k
    _blocks_returned_counter =
593
890k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
890k
    _output_block_bytes_counter =
595
890k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
890k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
890k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
890k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
890k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
890k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
890k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
890k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
890k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
890k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
890k
    _memory_used_counter =
606
890k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
890k
    _common_profile->add_info_string("IsColocate",
608
890k
                                     std::to_string(_parent->is_colocated_operator()));
609
890k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
890k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
890k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
890k
    return Status::OK();
613
890k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.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
54.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.2k
    if constexpr (!is_fake_shared) {
560
54.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
54.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
3.70k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
3.70k
            _dependency = _shared_state->create_source_dependency(
576
3.70k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
3.70k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
3.70k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
50.5k
        }
584
54.2k
    }
585
586
54.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
54.2k
    _rows_returned_counter =
591
54.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.2k
    _blocks_returned_counter =
593
54.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.2k
    _output_block_bytes_counter =
595
54.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.2k
    _memory_used_counter =
606
54.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.2k
    _common_profile->add_info_string("IsColocate",
608
54.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.2k
    return Status::OK();
613
54.2k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.27k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.27k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.27k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.27k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.27k
    _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.27k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.27k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.27k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.27k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.27k
    if constexpr (!is_fake_shared) {
560
5.27k
        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.27k
        } 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.24k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.24k
            _dependency = _shared_state->create_source_dependency(
576
5.24k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.24k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.24k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.24k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
29
        }
584
5.27k
    }
585
586
5.27k
    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.27k
    _rows_returned_counter =
591
5.27k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.27k
    _blocks_returned_counter =
593
5.27k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.27k
    _output_block_bytes_counter =
595
5.27k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.27k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.27k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.27k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.27k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.27k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.27k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.27k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.27k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.27k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.27k
    _memory_used_counter =
606
5.27k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.27k
    _common_profile->add_info_string("IsColocate",
608
5.27k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.27k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.27k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.27k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.27k
    return Status::OK();
613
5.27k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
465
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
465
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
465
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
465
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
465
    _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
465
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
465
    _operator_profile->add_child(_common_profile.get(), true);
557
465
    _operator_profile->add_child(_custom_profile.get(), true);
558
465
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
465
    if constexpr (!is_fake_shared) {
560
465
        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
465
        } 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
465
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
465
            _dependency = _shared_state->create_source_dependency(
576
465
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
465
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
465
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
465
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
465
    }
585
586
465
    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
465
    _rows_returned_counter =
591
465
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
465
    _blocks_returned_counter =
593
465
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
465
    _output_block_bytes_counter =
595
465
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
465
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
465
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
465
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
465
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
465
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
465
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
465
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
465
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
465
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
465
    _memory_used_counter =
606
465
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
465
    _common_profile->add_info_string("IsColocate",
608
465
                                     std::to_string(_parent->is_colocated_operator()));
609
465
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
465
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
465
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
465
    return Status::OK();
613
465
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.24k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.24k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.24k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.24k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.24k
    _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.24k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.24k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.24k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.24k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.24k
    if constexpr (!is_fake_shared) {
560
5.24k
        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.24k
        } 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.08k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.08k
            _dependency = _shared_state->create_source_dependency(
576
5.08k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.08k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.08k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.08k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
165
        }
584
5.24k
    }
585
586
5.24k
    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.24k
    _rows_returned_counter =
591
5.24k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.24k
    _blocks_returned_counter =
593
5.24k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.24k
    _output_block_bytes_counter =
595
5.24k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.24k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.24k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.24k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.24k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.24k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.24k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.24k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.24k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.24k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.24k
    _memory_used_counter =
606
5.24k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.24k
    _common_profile->add_info_string("IsColocate",
608
5.24k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.24k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.24k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.24k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.24k
    return Status::OK();
613
5.24k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
623k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
623k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
623k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
623k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
623k
    _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
623k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
623k
    _operator_profile->add_child(_common_profile.get(), true);
557
623k
    _operator_profile->add_child(_custom_profile.get(), true);
558
623k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
623k
    if constexpr (!is_fake_shared) {
560
623k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
612k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
612k
                                    .first.get()
563
612k
                                    ->template cast<SharedStateArg>();
564
565
612k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
612k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
612k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
612k
        } else if (info.shared_state) {
569
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
10.4k
        } else {
580
10.4k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
10.4k
                DCHECK(false);
582
10.4k
            }
583
10.4k
        }
584
623k
    }
585
586
623k
    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
623k
    _rows_returned_counter =
591
623k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
623k
    _blocks_returned_counter =
593
623k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
623k
    _output_block_bytes_counter =
595
623k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
623k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
623k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
623k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
623k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
623k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
623k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
623k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
623k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
623k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
623k
    _memory_used_counter =
606
623k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
623k
    _common_profile->add_info_string("IsColocate",
608
623k
                                     std::to_string(_parent->is_colocated_operator()));
609
623k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
623k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
623k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
623k
    return Status::OK();
613
623k
}
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.04M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.04M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.34M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
299k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
299k
    }
621
2.04M
    if (_parent->has_projection()) {
622
379k
        const auto& projection = *_parent->_projection;
623
379k
        _projections.resize(projection.projections.size());
624
2.38M
        for (size_t i = 0; i < _projections.size(); i++) {
625
2.00M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
2.00M
        }
627
379k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
396k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
16.9k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
224k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
207k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
207k
                        state, _intermediate_projections[i][j]));
633
207k
            }
634
16.9k
        }
635
379k
    }
636
2.04M
    return Status::OK();
637
2.04M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
71.7k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
71.7k
    _conjuncts.resize(_parent->_conjuncts.size());
618
73.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.65k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.65k
    }
621
71.7k
    if (_parent->has_projection()) {
622
71.7k
        const auto& projection = *_parent->_projection;
623
71.7k
        _projections.resize(projection.projections.size());
624
403k
        for (size_t i = 0; i < _projections.size(); i++) {
625
332k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
332k
        }
627
71.7k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
78.6k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.82k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
159k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
152k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
152k
                        state, _intermediate_projections[i][j]));
633
152k
            }
634
6.82k
        }
635
71.7k
    }
636
71.7k
    return Status::OK();
637
71.7k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
3
    _conjuncts.resize(_parent->_conjuncts.size());
618
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
3
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
3
    return Status::OK();
637
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
235k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
235k
    _conjuncts.resize(_parent->_conjuncts.size());
618
235k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
235k
    if (_parent->has_projection()) {
622
79
        const auto& projection = *_parent->_projection;
623
79
        _projections.resize(projection.projections.size());
624
400
        for (size_t i = 0; i < _projections.size(); i++) {
625
321
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
321
        }
627
79
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
79
        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
79
    }
636
235k
    return Status::OK();
637
235k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
23
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
23
    _conjuncts.resize(_parent->_conjuncts.size());
618
23
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
23
    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
23
    return Status::OK();
637
23
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.51k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.51k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.61k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
93
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
93
    }
621
6.52k
    if (_parent->has_projection()) {
622
6.52k
        const auto& projection = *_parent->_projection;
623
6.52k
        _projections.resize(projection.projections.size());
624
30.2k
        for (size_t i = 0; i < _projections.size(); i++) {
625
23.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
23.7k
        }
627
6.52k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.54k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
23
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
194
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
171
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
171
                        state, _intermediate_projections[i][j]));
633
171
            }
634
23
        }
635
6.52k
    }
636
6.51k
    return Status::OK();
637
6.51k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.46k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.46k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.34k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
881
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
881
    }
621
8.46k
    if (_parent->has_projection()) {
622
4.81k
        const auto& projection = *_parent->_projection;
623
4.81k
        _projections.resize(projection.projections.size());
624
19.5k
        for (size_t i = 0; i < _projections.size(); i++) {
625
14.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
14.7k
        }
627
4.81k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.90k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
91
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
687
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
596
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
596
                        state, _intermediate_projections[i][j]));
633
596
            }
634
91
        }
635
4.81k
    }
636
8.46k
    return Status::OK();
637
8.46k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
90.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
90.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
91.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.79k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.79k
    }
621
90.0k
    if (_parent->has_projection()) {
622
30.5k
        const auto& projection = *_parent->_projection;
623
30.5k
        _projections.resize(projection.projections.size());
624
277k
        for (size_t i = 0; i < _projections.size(); i++) {
625
246k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
246k
        }
627
30.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
30.7k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
179
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.13k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
955
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
955
                        state, _intermediate_projections[i][j]));
633
955
            }
634
179
        }
635
30.5k
    }
636
90.0k
    return Status::OK();
637
90.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
38.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
38.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
38.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
40
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
40
    }
621
38.6k
    if (_parent->has_projection()) {
622
229
        const auto& projection = *_parent->_projection;
623
229
        _projections.resize(projection.projections.size());
624
935
        for (size_t i = 0; i < _projections.size(); i++) {
625
706
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
706
        }
627
229
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
229
        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
229
    }
636
38.6k
    return Status::OK();
637
38.6k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
123
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
123
    _conjuncts.resize(_parent->_conjuncts.size());
618
123
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
123
    if (_parent->has_projection()) {
622
103
        const auto& projection = *_parent->_projection;
623
103
        _projections.resize(projection.projections.size());
624
309
        for (size_t i = 0; i < _projections.size(); i++) {
625
206
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
206
        }
627
103
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
103
        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
103
    }
636
123
    return Status::OK();
637
123
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
898k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
898k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.19M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
294k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
294k
    }
621
898k
    if (_parent->has_projection()) {
622
253k
        const auto& projection = *_parent->_projection;
623
253k
        _projections.resize(projection.projections.size());
624
1.54M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.29M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.29M
        }
627
253k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
263k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
9.57k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
58.3k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
48.7k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
48.7k
                        state, _intermediate_projections[i][j]));
633
48.7k
            }
634
9.57k
        }
635
253k
    }
636
898k
    return Status::OK();
637
898k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.4k
    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.4k
    if (_parent->has_projection()) {
622
11.4k
        const auto& projection = *_parent->_projection;
623
11.4k
        _projections.resize(projection.projections.size());
624
110k
        for (size_t i = 0; i < _projections.size(); i++) {
625
99.3k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
99.3k
        }
627
11.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.6k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
221
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
4.75k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
4.53k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
4.53k
                        state, _intermediate_projections[i][j]));
633
4.53k
            }
634
221
        }
635
11.4k
    }
636
54.4k
    return Status::OK();
637
54.4k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.25k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.25k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.78k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
532
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
532
    }
621
5.25k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
5.25k
    return Status::OK();
637
5.25k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
467
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
467
    _conjuncts.resize(_parent->_conjuncts.size());
618
467
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
467
    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
467
    return Status::OK();
637
467
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.28k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.28k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.28k
    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.28k
    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.28k
    return Status::OK();
637
5.28k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
626k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
626k
    _conjuncts.resize(_parent->_conjuncts.size());
618
626k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
626k
    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
626k
    return Status::OK();
637
626k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
169
    _conjuncts.resize(_parent->_conjuncts.size());
618
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
169
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
491
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
166
    }
636
169
    return Status::OK();
637
169
}
638
639
template <typename SharedStateArg>
640
6.04k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.04k
    if (_terminated) {
642
2
        return Status::OK();
643
2
    }
644
6.04k
    _terminated = true;
645
6.04k
    return Status::OK();
646
6.04k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
276
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
276
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
276
    _terminated = true;
645
276
    return Status::OK();
646
276
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
21
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
21
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
21
    _terminated = true;
645
21
    return Status::OK();
646
21
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
34
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
34
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
34
    _terminated = true;
645
34
    return Status::OK();
646
34
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
9
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
9
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
9
    _terminated = true;
645
9
    return Status::OK();
646
9
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
130
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
130
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
130
    _terminated = true;
645
130
    return Status::OK();
646
130
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4.25k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4.25k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
4.25k
    _terminated = true;
645
4.25k
    return Status::OK();
646
4.25k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
22
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
22
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
22
    _terminated = true;
645
22
    return Status::OK();
646
22
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
8
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
8
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
8
    _terminated = true;
645
8
    return Status::OK();
646
8
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
328
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
328
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
328
    _terminated = true;
645
328
    return Status::OK();
646
328
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
929
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
929
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
928
    _terminated = true;
645
928
    return Status::OK();
646
929
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
38
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
38
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
38
    _terminated = true;
645
38
    return Status::OK();
646
38
}
647
648
template <typename SharedStateArg>
649
2.30M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.30M
    if (_closed) {
651
263k
        return Status::OK();
652
263k
    }
653
2.04M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.14M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.14M
    }
656
2.04M
    _closed = true;
657
2.04M
    return Status::OK();
658
2.30M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
71.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
71.7k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
71.7k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
71.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
71.7k
    }
656
71.7k
    _closed = true;
657
71.7k
    return Status::OK();
658
71.7k
}
_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
466k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
466k
    if (_closed) {
651
234k
        return Status::OK();
652
234k
    }
653
232k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
232k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
232k
    }
656
232k
    _closed = true;
657
232k
    return Status::OK();
658
466k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
23
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
23
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
23
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
23
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
23
    }
656
23
    _closed = true;
657
23
    return Status::OK();
658
23
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.51k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.51k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.51k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.51k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.51k
    }
656
6.51k
    _closed = true;
657
6.51k
    return Status::OK();
658
6.51k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
17.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
17.0k
    if (_closed) {
651
8.65k
        return Status::OK();
652
8.65k
    }
653
8.44k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.44k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.44k
    }
656
8.44k
    _closed = true;
657
8.44k
    return Status::OK();
658
17.0k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
89.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
89.8k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
89.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
89.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
89.8k
    }
656
89.8k
    _closed = true;
657
89.8k
    return Status::OK();
658
89.8k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
38.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
38.4k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
38.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
38.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
38.4k
    }
656
38.4k
    _closed = true;
657
38.4k
    return Status::OK();
658
38.4k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
118
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
118
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
118
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
118
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
118
    }
656
118
    _closed = true;
657
118
    return Status::OK();
658
118
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
914k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
914k
    if (_closed) {
651
14.4k
        return Status::OK();
652
14.4k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
899k
    _closed = true;
657
899k
    return Status::OK();
658
914k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.4k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.4k
    }
656
54.4k
    _closed = true;
657
54.4k
    return Status::OK();
658
54.4k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.23k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.23k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.23k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.23k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.23k
    }
656
5.23k
    _closed = true;
657
5.23k
    return Status::OK();
658
5.23k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
727
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
727
    if (_closed) {
651
364
        return Status::OK();
652
364
    }
653
363
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
363
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
363
    }
656
363
    _closed = true;
657
363
    return Status::OK();
658
727
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.7k
    if (_closed) {
651
5.48k
        return Status::OK();
652
5.48k
    }
653
5.28k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.28k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.28k
    }
656
5.28k
    _closed = true;
657
5.28k
    return Status::OK();
658
10.7k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
628k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
628k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
628k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
628k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
628k
    }
656
628k
    _closed = true;
657
628k
    return Status::OK();
658
628k
}
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.14M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.14M
            info.shared_state_map.end()) {
682
276k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
219k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
219k
            }
685
276k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
276k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
276k
                                                  ? 0
688
276k
                                                  : info.task_idx]
689
276k
                                  .get();
690
276k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
866k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
866k
            _shared_state = info.shared_state->template cast<SharedState>();
696
866k
            _dependency = _shared_state->create_sink_dependency(
697
866k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
866k
        }
699
1.14M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.14M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.14M
    }
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
119k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
119k
    _operator_profile =
664
119k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
119k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
119k
    _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
119k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
119k
    _operator_profile->add_child(_common_profile, true);
673
119k
    _operator_profile->add_child(_custom_profile, true);
674
675
119k
    _operator_profile->set_metadata(_parent->node_id());
676
119k
    _wait_for_finish_dependency_timer =
677
119k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
119k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
119k
    if constexpr (!is_fake_shared) {
680
119k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
119k
            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
18.7k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
18.7k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
18.7k
                                                  ? 0
688
18.7k
                                                  : info.task_idx]
689
18.7k
                                  .get();
690
18.7k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
100k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
100k
            _shared_state = info.shared_state->template cast<SharedState>();
696
100k
            _dependency = _shared_state->create_sink_dependency(
697
100k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
100k
        }
699
119k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
119k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
119k
    }
702
703
119k
    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
119k
    _rows_input_counter =
708
119k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
119k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
119k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
119k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
119k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
119k
    _memory_used_counter =
714
119k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
119k
    _common_profile->add_info_string("IsColocate",
716
119k
                                     std::to_string(_parent->is_colocated_operator()));
717
119k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
119k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
119k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
119k
    return Status::OK();
721
119k
}
_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
234k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
234k
    _operator_profile =
664
234k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
234k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
234k
    _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
234k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
234k
    _operator_profile->add_child(_common_profile, true);
673
234k
    _operator_profile->add_child(_custom_profile, true);
674
675
234k
    _operator_profile->set_metadata(_parent->node_id());
676
234k
    _wait_for_finish_dependency_timer =
677
234k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
234k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
234k
    if constexpr (!is_fake_shared) {
680
234k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
234k
            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
234k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
234k
            _shared_state = info.shared_state->template cast<SharedState>();
696
234k
            _dependency = _shared_state->create_sink_dependency(
697
234k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
234k
        }
699
234k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
234k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
234k
    }
702
703
234k
    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
234k
    _rows_input_counter =
708
234k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
234k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
234k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
234k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
234k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
234k
    _memory_used_counter =
714
234k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
234k
    _common_profile->add_info_string("IsColocate",
716
234k
                                     std::to_string(_parent->is_colocated_operator()));
717
234k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
234k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
234k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
234k
    return Status::OK();
721
234k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
30
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
30
    _operator_profile =
664
30
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
30
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
30
    _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
30
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
30
    _operator_profile->add_child(_common_profile, true);
673
30
    _operator_profile->add_child(_custom_profile, true);
674
675
30
    _operator_profile->set_metadata(_parent->node_id());
676
30
    _wait_for_finish_dependency_timer =
677
30
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
30
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
30
    if constexpr (!is_fake_shared) {
680
30
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
30
            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
30
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
30
            _shared_state = info.shared_state->template cast<SharedState>();
696
30
            _dependency = _shared_state->create_sink_dependency(
697
30
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
30
        }
699
30
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
30
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
30
    }
702
703
30
    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
30
    _rows_input_counter =
708
30
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
30
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
30
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
30
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
30
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
30
    _memory_used_counter =
714
30
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
30
    _common_profile->add_info_string("IsColocate",
716
30
                                     std::to_string(_parent->is_colocated_operator()));
717
30
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
30
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
30
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
30
    return Status::OK();
721
30
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.51k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.51k
    _operator_profile =
664
6.51k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.51k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.51k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
6.51k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.51k
    _operator_profile->add_child(_common_profile, true);
673
6.51k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.51k
    _operator_profile->set_metadata(_parent->node_id());
676
6.51k
    _wait_for_finish_dependency_timer =
677
6.51k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.51k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.51k
    if constexpr (!is_fake_shared) {
680
6.51k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.51k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
6.51k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.51k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.51k
            _dependency = _shared_state->create_sink_dependency(
697
6.51k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.51k
        }
699
6.51k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.51k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.51k
    }
702
703
6.51k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
6.51k
    _rows_input_counter =
708
6.51k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.51k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.51k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.51k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.51k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.51k
    _memory_used_counter =
714
6.51k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.51k
    _common_profile->add_info_string("IsColocate",
716
6.51k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.51k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.51k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.51k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.51k
    return Status::OK();
721
6.51k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.41k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.41k
    _operator_profile =
664
8.41k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.41k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.41k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.41k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.41k
    _operator_profile->add_child(_common_profile, true);
673
8.41k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.41k
    _operator_profile->set_metadata(_parent->node_id());
676
8.41k
    _wait_for_finish_dependency_timer =
677
8.41k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.41k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.41k
    if constexpr (!is_fake_shared) {
680
8.41k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.41k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.41k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.41k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.41k
            _dependency = _shared_state->create_sink_dependency(
697
8.41k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.41k
        }
699
8.41k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.41k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.41k
    }
702
703
8.41k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.41k
    _rows_input_counter =
708
8.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.41k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.41k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.41k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.41k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.41k
    _memory_used_counter =
714
8.41k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.41k
    _common_profile->add_info_string("IsColocate",
716
8.41k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.41k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.41k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.41k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.41k
    return Status::OK();
721
8.41k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
89.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
89.7k
    _operator_profile =
664
89.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
89.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
89.7k
    _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.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
89.7k
    _operator_profile->add_child(_common_profile, true);
673
89.7k
    _operator_profile->add_child(_custom_profile, true);
674
675
89.7k
    _operator_profile->set_metadata(_parent->node_id());
676
89.7k
    _wait_for_finish_dependency_timer =
677
89.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
89.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
89.7k
    if constexpr (!is_fake_shared) {
680
89.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
89.7k
            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.7k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
89.7k
            _shared_state = info.shared_state->template cast<SharedState>();
696
89.7k
            _dependency = _shared_state->create_sink_dependency(
697
89.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
89.7k
        }
699
89.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
89.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
89.7k
    }
702
703
89.7k
    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.7k
    _rows_input_counter =
708
89.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
89.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
89.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
89.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
89.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
89.7k
    _memory_used_counter =
714
89.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
89.7k
    _common_profile->add_info_string("IsColocate",
716
89.7k
                                     std::to_string(_parent->is_colocated_operator()));
717
89.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
89.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
89.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
89.7k
    return Status::OK();
721
89.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
38.5k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
38.5k
    _operator_profile =
664
38.5k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
38.5k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
38.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
38.5k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
38.5k
    _operator_profile->add_child(_common_profile, true);
673
38.5k
    _operator_profile->add_child(_custom_profile, true);
674
675
38.5k
    _operator_profile->set_metadata(_parent->node_id());
676
38.5k
    _wait_for_finish_dependency_timer =
677
38.5k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
38.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
38.5k
    if constexpr (!is_fake_shared) {
680
38.5k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
38.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
38.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
38.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
38.5k
                                                  ? 0
688
38.5k
                                                  : info.task_idx]
689
38.5k
                                  .get();
690
38.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
38.5k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
34
            _shared_state = info.shared_state->template cast<SharedState>();
696
34
            _dependency = _shared_state->create_sink_dependency(
697
34
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
34
        }
699
38.5k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
38.5k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
38.5k
    }
702
703
38.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
38.5k
    _rows_input_counter =
708
38.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
38.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
38.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
38.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
38.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
38.5k
    _memory_used_counter =
714
38.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
38.5k
    _common_profile->add_info_string("IsColocate",
716
38.5k
                                     std::to_string(_parent->is_colocated_operator()));
717
38.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
38.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
38.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
38.5k
    return Status::OK();
721
38.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
129
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
129
    _operator_profile =
664
129
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
129
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
129
    _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
129
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
129
    _operator_profile->add_child(_common_profile, true);
673
129
    _operator_profile->add_child(_custom_profile, true);
674
675
129
    _operator_profile->set_metadata(_parent->node_id());
676
129
    _wait_for_finish_dependency_timer =
677
129
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
129
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
129
    if constexpr (!is_fake_shared) {
680
129
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
129
            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
129
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
129
            _shared_state = info.shared_state->template cast<SharedState>();
696
129
            _dependency = _shared_state->create_sink_dependency(
697
129
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
129
        }
699
129
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
129
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
129
    }
702
703
129
    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
129
    _rows_input_counter =
708
129
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
129
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
129
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
129
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
129
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
129
    _memory_used_counter =
714
129
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
129
    _common_profile->add_info_string("IsColocate",
716
129
                                     std::to_string(_parent->is_colocated_operator()));
717
129
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
129
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
129
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
129
    return Status::OK();
721
129
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
537k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
537k
    _operator_profile =
664
537k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
537k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
537k
    _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
537k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
537k
    _operator_profile->add_child(_common_profile, true);
673
537k
    _operator_profile->add_child(_custom_profile, true);
674
675
537k
    _operator_profile->set_metadata(_parent->node_id());
676
537k
    _wait_for_finish_dependency_timer =
677
537k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
537k
    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
537k
    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
537k
    _rows_input_counter =
708
537k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
537k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
537k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
537k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
537k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
537k
    _memory_used_counter =
714
537k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
537k
    _common_profile->add_info_string("IsColocate",
716
537k
                                     std::to_string(_parent->is_colocated_operator()));
717
537k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
537k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
537k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
537k
    return Status::OK();
721
537k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.34k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.34k
    _operator_profile =
664
8.34k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.34k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.34k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.34k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.34k
    _operator_profile->add_child(_common_profile, true);
673
8.34k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.34k
    _operator_profile->set_metadata(_parent->node_id());
676
8.34k
    _wait_for_finish_dependency_timer =
677
8.34k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.34k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.34k
    if constexpr (!is_fake_shared) {
680
8.34k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.34k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.34k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.34k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.34k
            _dependency = _shared_state->create_sink_dependency(
697
8.34k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.34k
        }
699
8.34k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.34k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.34k
    }
702
703
8.34k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.34k
    _rows_input_counter =
708
8.34k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.34k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.34k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.34k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.34k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.34k
    _memory_used_counter =
714
8.34k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.34k
    _common_profile->add_info_string("IsColocate",
716
8.34k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.34k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.34k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.34k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.34k
    return Status::OK();
721
8.34k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
466
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
466
    _operator_profile =
664
466
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
466
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
466
    _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
466
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
466
    _operator_profile->add_child(_common_profile, true);
673
466
    _operator_profile->add_child(_custom_profile, true);
674
675
466
    _operator_profile->set_metadata(_parent->node_id());
676
466
    _wait_for_finish_dependency_timer =
677
466
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
466
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
466
    if constexpr (!is_fake_shared) {
680
466
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
466
            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
466
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
466
            _shared_state = info.shared_state->template cast<SharedState>();
696
466
            _dependency = _shared_state->create_sink_dependency(
697
466
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
466
        }
699
466
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
466
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
466
    }
702
703
466
    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
466
    _rows_input_counter =
708
466
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
466
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
466
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
466
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
466
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
466
    _memory_used_counter =
714
466
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
466
    _common_profile->add_info_string("IsColocate",
716
466
                                     std::to_string(_parent->is_colocated_operator()));
717
466
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
466
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
466
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
466
    return Status::OK();
721
466
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.17k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.17k
    _operator_profile =
664
2.17k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.17k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.17k
    _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.17k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.17k
    _operator_profile->add_child(_common_profile, true);
673
2.17k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.17k
    _operator_profile->set_metadata(_parent->node_id());
676
2.17k
    _wait_for_finish_dependency_timer =
677
2.17k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.17k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.17k
    if constexpr (!is_fake_shared) {
680
2.17k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.17k
            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.17k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.17k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.17k
            _dependency = _shared_state->create_sink_dependency(
697
2.17k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.17k
        }
699
2.17k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.17k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.17k
    }
702
703
2.17k
    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.17k
    _rows_input_counter =
708
2.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.17k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.17k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.17k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.17k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.17k
    _memory_used_counter =
714
2.17k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.17k
    _common_profile->add_info_string("IsColocate",
716
2.17k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.17k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.17k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.17k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.17k
    return Status::OK();
721
2.17k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
13.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
13.0k
    _operator_profile =
664
13.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
13.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
13.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
13.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
13.0k
    _operator_profile->add_child(_common_profile, true);
673
13.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
13.0k
    _operator_profile->set_metadata(_parent->node_id());
676
13.0k
    _wait_for_finish_dependency_timer =
677
13.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
13.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
13.0k
    if constexpr (!is_fake_shared) {
680
13.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
13.0k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
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
13.0k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
13.0k
            _shared_state = info.shared_state->template cast<SharedState>();
696
13.0k
            _dependency = _shared_state->create_sink_dependency(
697
13.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
13.0k
        }
699
13.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
13.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
13.0k
    }
702
703
13.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
13.0k
    _rows_input_counter =
708
13.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
13.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
13.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
13.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
13.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
13.0k
    _memory_used_counter =
714
13.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
13.0k
    _common_profile->add_info_string("IsColocate",
716
13.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
13.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
13.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
13.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
13.0k
    return Status::OK();
721
13.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
219k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
219k
    _operator_profile =
664
219k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
219k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
219k
    _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
219k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
219k
    _operator_profile->add_child(_common_profile, true);
673
219k
    _operator_profile->add_child(_custom_profile, true);
674
675
219k
    _operator_profile->set_metadata(_parent->node_id());
676
219k
    _wait_for_finish_dependency_timer =
677
219k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
219k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
219k
    if constexpr (!is_fake_shared) {
680
219k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
219k
            info.shared_state_map.end()) {
682
219k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
219k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
219k
            }
685
219k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
219k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
219k
                                                  ? 0
688
219k
                                                  : info.task_idx]
689
219k
                                  .get();
690
219k
            _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
219k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
219k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
219k
    }
702
703
219k
    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
219k
    _rows_input_counter =
708
219k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
219k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
219k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
219k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
219k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
219k
    _memory_used_counter =
714
219k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
219k
    _common_profile->add_info_string("IsColocate",
716
219k
                                     std::to_string(_parent->is_colocated_operator()));
717
219k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
219k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
219k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
219k
    return Status::OK();
721
219k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
402k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
402k
    _operator_profile =
664
402k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
402k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
402k
    _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
402k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
402k
    _operator_profile->add_child(_common_profile, true);
673
402k
    _operator_profile->add_child(_custom_profile, true);
674
675
402k
    _operator_profile->set_metadata(_parent->node_id());
676
402k
    _wait_for_finish_dependency_timer =
677
402k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
402k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
402k
    if constexpr (!is_fake_shared) {
680
402k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
402k
            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
402k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
402k
            _shared_state = info.shared_state->template cast<SharedState>();
696
402k
            _dependency = _shared_state->create_sink_dependency(
697
402k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
402k
        }
699
402k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
402k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
402k
    }
702
703
402k
    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
402k
    _rows_input_counter =
708
402k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
402k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
402k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
402k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
402k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
402k
    _memory_used_counter =
714
402k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
402k
    _common_profile->add_info_string("IsColocate",
716
402k
                                     std::to_string(_parent->is_colocated_operator()));
717
402k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
402k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
402k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
402k
    return Status::OK();
721
402k
}
_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.68M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.68M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.68M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.14M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.14M
    }
731
1.68M
    _closed = true;
732
1.68M
    return Status::OK();
733
1.68M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
119k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
119k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
119k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
119k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
119k
    }
731
119k
    _closed = true;
732
119k
    return Status::OK();
733
119k
}
_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
234k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
234k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
234k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
234k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
234k
    }
731
234k
    _closed = true;
732
234k
    return Status::OK();
733
234k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
21
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
21
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
19
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
19
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
19
    }
731
19
    _closed = true;
732
19
    return Status::OK();
733
21
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.46k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.46k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.46k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.46k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.46k
    }
731
6.46k
    _closed = true;
732
6.46k
    return Status::OK();
733
6.46k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.40k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.40k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.40k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.40k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.40k
    }
731
8.40k
    _closed = true;
732
8.40k
    return Status::OK();
733
8.40k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
89.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
89.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
89.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
89.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
89.6k
    }
731
89.6k
    _closed = true;
732
89.6k
    return Status::OK();
733
89.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
38.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
38.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
38.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
38.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
38.4k
    }
731
38.4k
    _closed = true;
732
38.4k
    return Status::OK();
733
38.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
118
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
118
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
118
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
118
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
118
    }
731
118
    _closed = true;
732
118
    return Status::OK();
733
118
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
540k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
540k
    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
540k
    _closed = true;
732
540k
    return Status::OK();
733
540k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.35k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.35k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.35k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.35k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.35k
    }
731
8.35k
    _closed = true;
732
8.35k
    return Status::OK();
733
8.35k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
362
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
362
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
362
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
362
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
362
    }
731
362
    _closed = true;
732
362
    return Status::OK();
733
362
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.18k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.18k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.18k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.18k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.18k
    }
731
2.18k
    _closed = true;
732
2.18k
    return Status::OK();
733
2.18k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
13.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
13.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
13.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
13.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
13.0k
    }
731
13.0k
    _closed = true;
732
13.0k
    return Status::OK();
733
13.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
220k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
220k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
220k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
220k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
220k
    }
731
220k
    _closed = true;
732
220k
    return Status::OK();
733
220k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
404k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
404k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
404k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
404k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
404k
    }
731
404k
    _closed = true;
732
404k
    return Status::OK();
733
404k
}
_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
5.22k
                                                          bool* eos) {
738
5.22k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
5.21k
    return pull(state, block, eos);
740
5.22k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
38
                                                          bool* eos) {
738
38
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
38
    return pull(state, block, eos);
740
38
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
5.18k
                                                          bool* eos) {
738
5.18k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
5.18k
    return pull(state, block, eos);
740
5.18k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
558k
                                                         bool* eos) {
745
558k
    auto& local_state = get_local_state(state);
746
558k
    if (need_more_input_data(state)) {
747
526k
        local_state._child_block->clear_column_data(
748
526k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
526k
                        .num_materialized_slots());
750
526k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
526k
                state, local_state._child_block.get(), &local_state._child_eos));
752
526k
        *eos = local_state._child_eos;
753
526k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
56.3k
            return Status::OK();
755
56.3k
        }
756
470k
        {
757
470k
            SCOPED_TIMER(local_state.exec_time_counter());
758
470k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
470k
        }
760
470k
    }
761
762
502k
    if (!need_more_input_data(state)) {
763
474k
        SCOPED_TIMER(local_state.exec_time_counter());
764
474k
        bool new_eos = false;
765
474k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
474k
        if (new_eos) {
767
396k
            *eos = true;
768
396k
        } else if (!need_more_input_data(state)) {
769
25.4k
            *eos = false;
770
25.4k
        }
771
474k
    }
772
502k
    return Status::OK();
773
502k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
136k
                                                         bool* eos) {
745
136k
    auto& local_state = get_local_state(state);
746
136k
    if (need_more_input_data(state)) {
747
117k
        local_state._child_block->clear_column_data(
748
117k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
117k
                        .num_materialized_slots());
750
117k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
117k
                state, local_state._child_block.get(), &local_state._child_eos));
752
117k
        *eos = local_state._child_eos;
753
117k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
32.6k
            return Status::OK();
755
32.6k
        }
756
84.8k
        {
757
84.8k
            SCOPED_TIMER(local_state.exec_time_counter());
758
84.8k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
84.8k
        }
760
84.8k
    }
761
762
103k
    if (!need_more_input_data(state)) {
763
103k
        SCOPED_TIMER(local_state.exec_time_counter());
764
103k
        bool new_eos = false;
765
103k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
103k
        if (new_eos) {
767
47.3k
            *eos = true;
768
56.3k
        } else if (!need_more_input_data(state)) {
769
11.0k
            *eos = false;
770
11.0k
        }
771
103k
    }
772
103k
    return Status::OK();
773
103k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.07k
                                                         bool* eos) {
745
4.07k
    auto& local_state = get_local_state(state);
746
4.07k
    if (need_more_input_data(state)) {
747
2.12k
        local_state._child_block->clear_column_data(
748
2.12k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.12k
                        .num_materialized_slots());
750
2.12k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.12k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.12k
        *eos = local_state._child_eos;
753
2.12k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
277
            return Status::OK();
755
277
        }
756
1.84k
        {
757
1.84k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.84k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.84k
        }
760
1.84k
    }
761
762
3.81k
    if (!need_more_input_data(state)) {
763
3.81k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.81k
        bool new_eos = false;
765
3.81k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.81k
        if (new_eos) {
767
1.25k
            *eos = true;
768
2.56k
        } else if (!need_more_input_data(state)) {
769
1.95k
            *eos = false;
770
1.95k
        }
771
3.81k
    }
772
3.79k
    return Status::OK();
773
3.79k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.95k
                                                         bool* eos) {
745
1.95k
    auto& local_state = get_local_state(state);
746
1.95k
    if (need_more_input_data(state)) {
747
1.95k
        local_state._child_block->clear_column_data(
748
1.95k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.95k
                        .num_materialized_slots());
750
1.95k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.95k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.95k
        *eos = local_state._child_eos;
753
1.95k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
764
            return Status::OK();
755
764
        }
756
1.19k
        {
757
1.19k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.19k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.19k
        }
760
1.19k
    }
761
762
1.19k
    if (!need_more_input_data(state)) {
763
1.19k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.19k
        bool new_eos = false;
765
1.19k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.19k
        if (new_eos) {
767
784
            *eos = true;
768
784
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.19k
    }
772
1.19k
    return Status::OK();
773
1.19k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
14.6k
                                                         bool* eos) {
745
14.6k
    auto& local_state = get_local_state(state);
746
14.6k
    if (need_more_input_data(state)) {
747
14.6k
        local_state._child_block->clear_column_data(
748
14.6k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
14.6k
                        .num_materialized_slots());
750
14.6k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
14.6k
                state, local_state._child_block.get(), &local_state._child_eos));
752
14.6k
        *eos = local_state._child_eos;
753
14.6k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
3.34k
            return Status::OK();
755
3.34k
        }
756
11.2k
        {
757
11.2k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.2k
        }
760
11.2k
    }
761
762
11.2k
    if (!need_more_input_data(state)) {
763
6.11k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.11k
        bool new_eos = false;
765
6.11k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.11k
        if (new_eos) {
767
6.04k
            *eos = true;
768
6.04k
        } else if (!need_more_input_data(state)) {
769
8
            *eos = false;
770
8
        }
771
6.11k
    }
772
11.2k
    return Status::OK();
773
11.2k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
371k
                                                         bool* eos) {
745
371k
    auto& local_state = get_local_state(state);
746
372k
    if (need_more_input_data(state)) {
747
372k
        local_state._child_block->clear_column_data(
748
372k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
372k
                        .num_materialized_slots());
750
372k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
372k
                state, local_state._child_block.get(), &local_state._child_eos));
752
372k
        *eos = local_state._child_eos;
753
372k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
17.1k
            return Status::OK();
755
17.1k
        }
756
355k
        {
757
355k
            SCOPED_TIMER(local_state.exec_time_counter());
758
355k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
355k
        }
760
355k
    }
761
762
354k
    if (!need_more_input_data(state)) {
763
331k
        SCOPED_TIMER(local_state.exec_time_counter());
764
331k
        bool new_eos = false;
765
331k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
331k
        if (new_eos) {
767
330k
            *eos = true;
768
330k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
331k
    }
772
354k
    return Status::OK();
773
354k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
23.1k
                                                         bool* eos) {
745
23.1k
    auto& local_state = get_local_state(state);
746
23.1k
    if (need_more_input_data(state)) {
747
11.0k
        local_state._child_block->clear_column_data(
748
11.0k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
11.0k
                        .num_materialized_slots());
750
11.0k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
11.0k
                state, local_state._child_block.get(), &local_state._child_eos));
752
11.0k
        *eos = local_state._child_eos;
753
11.0k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
892
            return Status::OK();
755
892
        }
756
10.1k
        {
757
10.1k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.1k
        }
760
10.1k
    }
761
762
22.2k
    if (!need_more_input_data(state)) {
763
21.7k
        SCOPED_TIMER(local_state.exec_time_counter());
764
21.7k
        bool new_eos = false;
765
21.7k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
21.7k
        if (new_eos) {
767
6.49k
            *eos = true;
768
15.2k
        } else if (!need_more_input_data(state)) {
769
12.0k
            *eos = false;
770
12.0k
        }
771
21.7k
    }
772
22.2k
    return Status::OK();
773
22.2k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.06k
                                                         bool* eos) {
745
7.06k
    auto& local_state = get_local_state(state);
746
7.06k
    if (need_more_input_data(state)) {
747
6.70k
        local_state._child_block->clear_column_data(
748
6.70k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.70k
                        .num_materialized_slots());
750
6.70k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.70k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.70k
        *eos = local_state._child_eos;
753
6.70k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.29k
            return Status::OK();
755
1.29k
        }
756
5.40k
        {
757
5.40k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.40k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.40k
        }
760
5.40k
    }
761
762
5.76k
    if (!need_more_input_data(state)) {
763
5.75k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.75k
        bool new_eos = false;
765
5.75k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.75k
        if (new_eos) {
767
3.74k
            *eos = true;
768
3.74k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
5.75k
    }
772
5.76k
    return Status::OK();
773
5.76k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
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_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
357
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
357
    RETURN_IF_ERROR(Base::init(state, info));
779
357
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
357
                                                         "AsyncWriterDependency", true);
781
357
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
357
                             _finish_dependency));
783
784
357
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
357
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
357
    return Status::OK();
787
357
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
46.0k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.0k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.0k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.0k
                                                         "AsyncWriterDependency", true);
781
46.0k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.0k
                             _finish_dependency));
783
784
46.0k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.0k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.0k
    return Status::OK();
787
46.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
27
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
27
    RETURN_IF_ERROR(Base::init(state, info));
779
27
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
27
                                                         "AsyncWriterDependency", true);
781
27
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
27
                             _finish_dependency));
783
784
27
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
27
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
27
    return Status::OK();
787
27
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
47.1k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.1k
    RETURN_IF_ERROR(Base::open(state));
793
47.1k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
370k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
323k
        RETURN_IF_ERROR(
796
323k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
323k
    }
798
47.1k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.1k
    return Status::OK();
800
47.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
357
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
357
    RETURN_IF_ERROR(Base::open(state));
793
357
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.84k
    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
357
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
357
    return Status::OK();
800
357
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
46.7k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.7k
    RETURN_IF_ERROR(Base::open(state));
793
46.7k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
368k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
321k
        RETURN_IF_ERROR(
796
321k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
321k
    }
798
46.7k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.7k
    return Status::OK();
800
46.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
27
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
27
    RETURN_IF_ERROR(Base::open(state));
793
27
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
486
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
459
        RETURN_IF_ERROR(
796
459
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
459
    }
798
27
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
27
    return Status::OK();
800
27
}
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.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.0k
    return _writer->sink(block, eos);
806
62.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.21k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.21k
    return _writer->sink(block, eos);
806
1.21k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
60.7k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
60.7k
    return _writer->sink(block, eos);
806
60.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
27
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
27
    return _writer->sink(block, eos);
806
27
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
47.1k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.1k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.1k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.1k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
47.1k
    if (_writer) {
818
47.1k
        Status st = _writer->get_writer_status();
819
47.1k
        if (exec_status.ok()) {
820
47.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.1k
                                                       : Status::Cancelled("force close"));
822
47.1k
        } else {
823
52
            _writer->force_close(exec_status);
824
52
        }
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.1k
    return Base::close(state, exec_status);
831
47.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
345
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
345
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
345
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
345
    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
345
    if (_writer) {
818
345
        Status st = _writer->get_writer_status();
819
345
        if (exec_status.ok()) {
820
345
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
345
                                                       : Status::Cancelled("force close"));
822
345
        } 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
345
        RETURN_IF_ERROR(st);
829
345
    }
830
345
    return Base::close(state, exec_status);
831
345
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
46.8k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
46.8k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
46.8k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
46.8k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
46.8k
    if (_writer) {
818
46.8k
        Status st = _writer->get_writer_status();
819
46.8k
        if (exec_status.ok()) {
820
46.7k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
46.7k
                                                       : Status::Cancelled("force close"));
822
46.7k
        } else {
823
52
            _writer->force_close(exec_status);
824
52
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
46.8k
        RETURN_IF_ERROR(st);
829
46.8k
    }
830
46.7k
    return Base::close(state, exec_status);
831
46.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
27
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
27
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
27
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
27
    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
27
    if (_writer) {
818
27
        Status st = _writer->get_writer_status();
819
27
        if (exec_status.ok()) {
820
27
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
27
                                                       : Status::Cancelled("force close"));
822
27
        } 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
27
        RETURN_IF_ERROR(st);
829
27
    }
830
27
    return Base::close(state, exec_status);
831
27
}
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