Coverage Report

Created: 2026-09-17 15:46

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.60M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.60M
    if (_parent->nereids_id() == -1) {
122
835k
        return fmt::format("(id={})", _parent->node_id());
123
835k
    } else {
124
773k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
773k
    }
126
1.60M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
68.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
68.4k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
68.4k
    } else {
124
68.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
68.4k
    }
126
68.4k
}
_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
197k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
197k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
197k
    } else {
124
197k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
197k
    }
126
197k
}
_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.67k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.67k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
6.67k
    } else {
124
6.67k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.67k
    }
126
6.67k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.39k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.39k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
8.38k
    } else {
124
8.38k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.38k
    }
126
8.39k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
88.2k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
88.2k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
88.2k
    } else {
124
88.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
88.2k
    }
126
88.2k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
59.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
59.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
59.1k
    } else {
124
59.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
59.1k
    }
126
59.1k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
124
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
124
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
124
    } else {
124
124
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
124
    }
126
124
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
545k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
545k
    if (_parent->nereids_id() == -1) {
122
261k
        return fmt::format("(id={})", _parent->node_id());
123
284k
    } else {
124
284k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
284k
    }
126
545k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.8k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.8k
    } else {
124
54.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.8k
    }
126
54.8k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.85k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.85k
    if (_parent->nereids_id() == -1) {
122
4.85k
        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
4.85k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
645
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
645
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
543
    } else {
124
543
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
543
    }
126
645
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.29k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.29k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.28k
    } else {
124
5.28k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.28k
    }
126
5.29k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
568k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
568k
    if (_parent->nereids_id() == -1) {
122
568k
        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
568k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
169
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
169
    } else {
124
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
169
    }
126
169
}
127
128
template <typename SharedStateArg>
129
1.11M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.11M
    if (_parent->nereids_id() == -1) {
131
629k
        return fmt::format("(id={})", _parent->node_id());
132
629k
    } else {
133
488k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
488k
    }
135
1.11M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
116k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
116k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
116k
    } else {
133
116k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
116k
    }
135
116k
}
_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
197k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
197k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
197k
    } else {
133
197k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
197k
    }
135
197k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
30
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
30
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
30
    } else {
133
30
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
30
    }
135
30
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
6.85k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6.85k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
6.85k
    } else {
133
6.85k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
6.85k
    }
135
6.85k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.46k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.46k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
8.45k
    } else {
133
8.45k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.45k
    }
135
8.46k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
89.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
89.0k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
89.0k
    } else {
133
89.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
89.0k
    }
135
89.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
59.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
59.0k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
59.0k
    } else {
133
59.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
59.0k
    }
135
59.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
134
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
134
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
134
    } else {
133
134
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
134
    }
135
134
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
21
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
21
    if (_parent->nereids_id() == -1) {
131
21
        return fmt::format("(id={})", _parent->node_id());
132
21
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
21
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9.81k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9.81k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
9.81k
    } else {
133
9.81k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
9.81k
    }
135
9.81k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
650
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
650
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
548
    } else {
133
548
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
548
    }
135
650
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
13.0k
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
13.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
233k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
233k
    if (_parent->nereids_id() == -1) {
131
233k
        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
233k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
383k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
383k
    if (_parent->nereids_id() == -1) {
131
382k
        return fmt::format("(id={})", _parent->node_id());
132
382k
    } else {
133
482
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
482
    }
135
383k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        return fmt::format("(id={})", _parent->node_id());
132
25
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
338
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
338
    } else {
133
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
338
    }
135
338
}
136
137
template <typename SharedStateArg>
138
30.8k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
30.8k
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
30.8k
    _terminated = true;
143
30.8k
    return Status::OK();
144
30.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2.88k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.88k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.88k
    _terminated = true;
143
2.88k
    return Status::OK();
144
2.88k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_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_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.66k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.66k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.66k
    _terminated = true;
143
1.66k
    return Status::OK();
144
1.66k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
809
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
809
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
809
    _terminated = true;
143
809
    return Status::OK();
144
809
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
413
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
413
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
412
    _terminated = true;
143
412
    return Status::OK();
144
413
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
235
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
235
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
235
    _terminated = true;
143
235
    return Status::OK();
144
235
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_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_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
212
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
212
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
212
    _terminated = true;
143
212
    return Status::OK();
144
212
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
16
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
16
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
16
    _terminated = true;
143
16
    return Status::OK();
144
16
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
366
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
366
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
366
    _terminated = true;
143
366
    return Status::OK();
144
366
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
132
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
132
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
132
    _terminated = true;
143
132
    return Status::OK();
144
132
}
145
146
309k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
309k
    return _child && _child->is_serial_operator() && !is_source()
148
309k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
309k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
309k
}
151
152
25.3k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
25.3k
    if (!_child) {
154
24.0k
        return false;
155
24.0k
    }
156
1.22k
    if (_child->is_serial_operator()) {
157
169
        return true;
158
169
    }
159
1.05k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.05k
    return child_distribution.need_local_exchange() &&
161
1.05k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.22k
}
163
164
template <typename SharedStateArg>
165
15.7k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
15.7k
    fmt::memory_buffer debug_string_buffer;
167
15.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
15.7k
    return fmt::to_string(debug_string_buffer);
169
15.7k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
15.7k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
15.7k
    fmt::memory_buffer debug_string_buffer;
167
15.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
15.7k
    return fmt::to_string(debug_string_buffer);
169
15.7k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
15.7k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
15.7k
    fmt::memory_buffer debug_string_buffer;
174
15.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
15.7k
    return fmt::to_string(debug_string_buffer);
176
15.7k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
15.7k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
15.7k
    fmt::memory_buffer debug_string_buffer;
174
15.7k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
15.7k
    return fmt::to_string(debug_string_buffer);
176
15.7k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
15.7k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
15.7k
    fmt::memory_buffer debug_string_buffer;
180
15.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
15.7k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
15.7k
                   _is_serial_operator);
183
15.7k
    return fmt::to_string(debug_string_buffer);
184
15.7k
}
185
186
15.7k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
15.7k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
15.7k
}
189
190
657k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
657k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
657k
    _nereids_id = tnode.nereids_id;
193
657k
    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
657k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
657k
    _op_name = substr + "_OPERATOR";
208
209
657k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
657k
    } else if (tnode.__isset.conjuncts) {
212
272k
        for (const auto& conjunct : tnode.conjuncts) {
213
272k
            VExprContextSPtr context;
214
272k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
272k
            _conjuncts.emplace_back(context);
216
272k
        }
217
99.0k
    }
218
219
    // create the projections expr
220
657k
    if (tnode.__isset.projections) {
221
260k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
260k
    }
223
657k
    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.56k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.56k
            VExprContextSPtrs projections;
228
6.56k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.56k
            _projection->intermediate_projections.push_back(projections);
230
6.56k
        }
231
3.87k
    }
232
657k
    return Status::OK();
233
657k
}
234
235
684k
Status OperatorXBase::prepare(RuntimeState* state) {
236
684k
    for (auto& conjunct : _conjuncts) {
237
272k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
272k
    }
239
684k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
634k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
339k
            return a->execute_cost() < b->execute_cost();
242
339k
        });
243
634k
    };
244
245
684k
    if (has_projection()) {
246
260k
        auto& projection = *_projection;
247
266k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.56k
            const auto& input_row_desc =
249
6.56k
                    i == 0 ? operator_row_desc_before_projection()
250
6.56k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.56k
            RETURN_IF_ERROR(
252
6.56k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.56k
        }
254
260k
        const auto& final_projection_input_row_desc =
255
260k
                projection.intermediate_output_row_descriptors.empty()
256
260k
                        ? operator_row_desc_before_projection()
257
260k
                        : projection.intermediate_output_row_descriptors.back();
258
260k
        RETURN_IF_ERROR(
259
260k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
260k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
260k
                                                      projection.output_row_descriptor));
262
260k
    }
263
264
684k
    for (auto& conjunct : _conjuncts) {
265
272k
        RETURN_IF_ERROR(conjunct->open(state));
266
272k
    }
267
684k
    if (has_projection()) {
268
260k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
260k
        for (auto& projections : _projection->intermediate_projections) {
270
6.56k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.56k
        }
272
260k
    }
273
684k
    if (_child && !is_source()) {
274
98.1k
        RETURN_IF_ERROR(_child->prepare(state));
275
98.1k
    }
276
277
684k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
684k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
684k
    return Status::OK();
283
684k
}
284
285
7.53k
Status OperatorXBase::terminate(RuntimeState* state) {
286
7.53k
    if (_child && !is_source()) {
287
710
        RETURN_IF_ERROR(_child->terminate(state));
288
710
    }
289
7.53k
    auto result = state->get_local_state_result(operator_id());
290
7.53k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
7.53k
    return result.value()->terminate(state);
294
7.53k
}
295
296
4.37M
Status OperatorXBase::close(RuntimeState* state) {
297
4.37M
    if (_child && !is_source()) {
298
698k
        RETURN_IF_ERROR(_child->close(state));
299
698k
    }
300
4.37M
    auto result = state->get_local_state_result(operator_id());
301
4.37M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.37M
    return result.value()->close(state);
305
4.37M
}
306
307
283k
void PipelineXLocalStateBase::clear_origin_block() {
308
283k
    _origin_block.clear_column_data(
309
283k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
283k
}
311
312
600k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
600k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
600k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
600k
    return Status::OK();
317
600k
}
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
283k
                                     Block* output_block) const {
326
283k
    auto* local_state = state->get_local_state(operator_id());
327
283k
    SCOPED_TIMER(local_state->exec_time_counter());
328
283k
    SCOPED_TIMER(local_state->_projection_timer);
329
283k
    const size_t rows = origin_block->rows();
330
283k
    if (rows == 0) {
331
154k
        return Status::OK();
332
154k
    }
333
129k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
129k
    {
336
129k
        Block input_block = *origin_block;
337
338
129k
        ColumnsWithTypeAndName new_columns;
339
129k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.77k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.77k
            new_columns.resize(projections.size());
345
68.2k
            for (int i = 0; i < projections.size(); i++) {
346
64.4k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
64.4k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
64.4k
            }
355
3.76k
            Block tmp_block {new_columns};
356
3.76k
            input_block.swap(tmp_block);
357
3.76k
        }
358
359
129k
        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
129k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
129k
                output_block, _projection->output_row_descriptor);
368
129k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
129k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
129k
        Columns shared_columns(mutable_columns.size());
371
372
745k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
616k
            ColumnPtr column_ptr;
374
616k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
616k
            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
616k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
616k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
616k
            if (column_ptr->is_exclusive()) {
386
225k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
391k
            } else {
388
391k
                shared_columns[i] = std::move(column_ptr);
389
391k
            }
390
616k
        }
391
392
129k
        scoped_mutable_block.restore();
393
745k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
616k
            if (shared_columns[i]) {
395
391k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
391k
            }
397
616k
        }
398
129k
    }
399
400
0
    origin_block->clear_column_data(
401
129k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
129k
    DCHECK_EQ(output_block->rows(), rows);
403
404
129k
    return Status::OK();
405
129k
}
406
407
3.85M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
3.85M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
3.85M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
3.85M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
3.85M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
3.85M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
3.85M
            if (_debug_point_count++ % 2 == 0) {
414
3.85M
                return Status::OK();
415
3.85M
            }
416
3.85M
        }
417
3.85M
    });
418
419
3.85M
    Status status;
420
3.85M
    auto* local_state = state->get_local_state(operator_id());
421
3.85M
    Defer defer([&]() {
422
3.85M
        if (status.ok()) {
423
3.85M
            local_state->update_output_block_counters(*block);
424
3.85M
        }
425
3.85M
    });
426
3.85M
    if (has_projection()) {
427
283k
        local_state->clear_origin_block();
428
283k
        status = get_block(state, &local_state->_origin_block, eos);
429
283k
        if (UNLIKELY(!status.ok())) {
430
24
            return status;
431
24
        }
432
283k
        status = do_projections(state, &local_state->_origin_block, block);
433
283k
        return status;
434
283k
    }
435
3.57M
    status = get_block(state, block, eos);
436
3.57M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.57M
    return status;
438
3.57M
}
439
440
2.51M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.51M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.51k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.51k
        *eos = true;
444
9.51k
    }
445
446
2.51M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.51M
        auto op_name = to_lower(_parent->_op_name);
448
2.51M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.51M
        arg_op_name = to_lower(arg_op_name);
450
451
2.51M
        if (op_name == arg_op_name) {
452
2.51M
            *eos = true;
453
2.51M
        }
454
2.51M
    });
455
456
2.51M
    if (auto rows = block->rows()) {
457
731k
        _num_rows_returned += rows;
458
731k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
731k
    }
460
2.51M
}
461
462
30.8k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
30.8k
    auto result = state->get_sink_local_state_result();
464
30.8k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
30.8k
    return result.value()->terminate(state);
468
30.8k
}
469
470
15.7k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
15.7k
    fmt::memory_buffer debug_string_buffer;
472
473
15.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
15.7k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
15.7k
    return fmt::to_string(debug_string_buffer);
476
15.7k
}
477
478
15.7k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
15.7k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
15.7k
}
481
482
341k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
341k
    std::string op_name = "UNKNOWN_SINK";
484
341k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
342k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
342k
        op_name = it->second;
488
342k
    }
489
341k
    _name = op_name + "_OPERATOR";
490
341k
    return Status::OK();
491
341k
}
492
493
291k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
291k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
291k
    _nereids_id = tnode.nereids_id;
496
291k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
291k
    _name = substr + "_SINK_OPERATOR";
498
291k
    return Status::OK();
499
291k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.58M
                                                            LocalSinkStateInfo& info) {
504
1.58M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.58M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.58M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.58M
    return Status::OK();
508
1.58M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
116k
                                                            LocalSinkStateInfo& info) {
504
116k
    auto local_state = LocalStateType::create_unique(this, state);
505
116k
    RETURN_IF_ERROR(local_state->init(state, info));
506
116k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
116k
    return Status::OK();
508
116k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
338k
                                                            LocalSinkStateInfo& info) {
504
338k
    auto local_state = LocalStateType::create_unique(this, state);
505
338k
    RETURN_IF_ERROR(local_state->init(state, info));
506
338k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
338k
    return Status::OK();
508
338k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
3
                                                            LocalSinkStateInfo& info) {
504
3
    auto local_state = LocalStateType::create_unique(this, state);
505
3
    RETURN_IF_ERROR(local_state->init(state, info));
506
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
3
    return Status::OK();
508
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
359
                                                            LocalSinkStateInfo& info) {
504
359
    auto local_state = LocalStateType::create_unique(this, state);
505
359
    RETURN_IF_ERROR(local_state->init(state, info));
506
359
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
359
    return Status::OK();
508
359
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
46.0k
                                                            LocalSinkStateInfo& info) {
504
46.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
46.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
46.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
46.0k
    return Status::OK();
508
46.0k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
30
                                                            LocalSinkStateInfo& info) {
504
30
    auto local_state = LocalStateType::create_unique(this, state);
505
30
    RETURN_IF_ERROR(local_state->init(state, info));
506
30
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
30
    return Status::OK();
508
30
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.45k
                                                            LocalSinkStateInfo& info) {
504
8.45k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.45k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.45k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.45k
    return Status::OK();
508
8.45k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
18
                                                            LocalSinkStateInfo& info) {
504
18
    auto local_state = LocalStateType::create_unique(this, state);
505
18
    RETURN_IF_ERROR(local_state->init(state, info));
506
18
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
18
    return Status::OK();
508
18
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
198k
                                                            LocalSinkStateInfo& info) {
504
198k
    auto local_state = LocalStateType::create_unique(this, state);
505
198k
    RETURN_IF_ERROR(local_state->init(state, info));
506
198k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
198k
    return Status::OK();
508
198k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
30
                                                            LocalSinkStateInfo& info) {
504
30
    auto local_state = LocalStateType::create_unique(this, state);
505
30
    RETURN_IF_ERROR(local_state->init(state, info));
506
30
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
30
    return Status::OK();
508
30
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_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_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
89.2k
                                                            LocalSinkStateInfo& info) {
504
89.2k
    auto local_state = LocalStateType::create_unique(this, state);
505
89.2k
    RETURN_IF_ERROR(local_state->init(state, info));
506
89.2k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
89.2k
    return Status::OK();
508
89.2k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
59.0k
                                                            LocalSinkStateInfo& info) {
504
59.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
59.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
59.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
59.0k
    return Status::OK();
508
59.0k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
134
                                                            LocalSinkStateInfo& info) {
504
134
    auto local_state = LocalStateType::create_unique(this, state);
505
134
    RETURN_IF_ERROR(local_state->init(state, info));
506
134
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
134
    return Status::OK();
508
134
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
462k
                                                            LocalSinkStateInfo& info) {
504
462k
    auto local_state = LocalStateType::create_unique(this, state);
505
462k
    RETURN_IF_ERROR(local_state->init(state, info));
506
462k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
462k
    return Status::OK();
508
462k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.89k
                                                            LocalSinkStateInfo& info) {
504
6.89k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.89k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.89k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.89k
    return Status::OK();
508
6.89k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
9.82k
                                                            LocalSinkStateInfo& info) {
504
9.82k
    auto local_state = LocalStateType::create_unique(this, state);
505
9.82k
    RETURN_IF_ERROR(local_state->init(state, info));
506
9.82k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9.82k
    return Status::OK();
508
9.82k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1.92k
                                                            LocalSinkStateInfo& info) {
504
1.92k
    auto local_state = LocalStateType::create_unique(this, state);
505
1.92k
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.92k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.92k
    return Status::OK();
508
1.92k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
545
                                                            LocalSinkStateInfo& info) {
504
545
    auto local_state = LocalStateType::create_unique(this, state);
505
545
    RETURN_IF_ERROR(local_state->init(state, info));
506
545
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
545
    return Status::OK();
508
545
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.99k
                                                            LocalSinkStateInfo& info) {
504
4.99k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.99k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.99k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.99k
    return Status::OK();
508
4.99k
}
_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.70k
                                                            LocalSinkStateInfo& info) {
504
2.70k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.70k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.70k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.70k
    return Status::OK();
508
2.70k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.55k
                                                            LocalSinkStateInfo& info) {
504
2.55k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.55k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.55k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.55k
    return Status::OK();
508
2.55k
}
_ZN5doris17DataSinkOperatorXINS_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
566
                                                            LocalSinkStateInfo& info) {
504
566
    auto local_state = LocalStateType::create_unique(this, state);
505
566
    RETURN_IF_ERROR(local_state->init(state, info));
506
566
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
566
    return Status::OK();
508
566
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
106
                                                            LocalSinkStateInfo& info) {
504
106
    auto local_state = LocalStateType::create_unique(this, state);
505
106
    RETURN_IF_ERROR(local_state->init(state, info));
506
106
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
106
    return Status::OK();
508
106
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
509
510
template <typename LocalStateType>
511
1.26M
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.26M
    } else {
519
1.26M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.26M
        ss->id = operator_id();
521
1.26M
        for (auto& dest : dests_id()) {
522
1.25M
            ss->related_op_ids.insert(dest);
523
1.25M
        }
524
1.26M
        return ss;
525
1.26M
    }
526
1.26M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
101k
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
101k
    } else {
519
101k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
101k
        ss->id = operator_id();
521
101k
        for (auto& dest : dests_id()) {
522
101k
            ss->related_op_ids.insert(dest);
523
101k
        }
524
101k
        return ss;
525
101k
    }
526
101k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
338k
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
338k
    } else {
519
338k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
338k
        ss->id = operator_id();
521
338k
        for (auto& dest : dests_id()) {
522
336k
            ss->related_op_ids.insert(dest);
523
336k
        }
524
338k
        return ss;
525
338k
    }
526
338k
}
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
360
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
360
    } else {
519
360
        auto ss = LocalStateType::SharedStateType::create_shared();
520
360
        ss->id = operator_id();
521
360
        for (auto& dest : dests_id()) {
522
358
            ss->related_op_ids.insert(dest);
523
358
        }
524
360
        return ss;
525
360
    }
526
360
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46.2k
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.2k
    } else {
519
46.2k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46.2k
        ss->id = operator_id();
521
46.2k
        for (auto& dest : dests_id()) {
522
45.8k
            ss->related_op_ids.insert(dest);
523
45.8k
        }
524
46.2k
        return ss;
525
46.2k
    }
526
46.2k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
30
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
30
    } else {
519
30
        auto ss = LocalStateType::SharedStateType::create_shared();
520
30
        ss->id = operator_id();
521
30
        for (auto& dest : dests_id()) {
522
30
            ss->related_op_ids.insert(dest);
523
30
        }
524
30
        return ss;
525
30
    }
526
30
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
8.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
8.51k
    } else {
519
8.51k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.51k
        ss->id = operator_id();
521
8.52k
        for (auto& dest : dests_id()) {
522
8.52k
            ss->related_op_ids.insert(dest);
523
8.52k
        }
524
8.51k
        return ss;
525
8.51k
    }
526
8.51k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
18
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
18
    } else {
519
18
        auto ss = LocalStateType::SharedStateType::create_shared();
520
18
        ss->id = operator_id();
521
18
        for (auto& dest : dests_id()) {
522
18
            ss->related_op_ids.insert(dest);
523
18
        }
524
18
        return ss;
525
18
    }
526
18
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
199k
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
199k
    } else {
519
199k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
199k
        ss->id = operator_id();
521
199k
        for (auto& dest : dests_id()) {
522
199k
            ss->related_op_ids.insert(dest);
523
199k
        }
524
199k
        return ss;
525
199k
    }
526
199k
}
_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.4k
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.4k
    } else {
519
89.4k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
89.4k
        ss->id = operator_id();
521
89.4k
        for (auto& dest : dests_id()) {
522
89.4k
            ss->related_op_ids.insert(dest);
523
89.4k
        }
524
89.4k
        return ss;
525
89.4k
    }
526
89.4k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
133
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
133
    } else {
519
133
        auto ss = LocalStateType::SharedStateType::create_shared();
520
133
        ss->id = operator_id();
521
133
        for (auto& dest : dests_id()) {
522
133
            ss->related_op_ids.insert(dest);
523
133
        }
524
133
        return ss;
525
133
    }
526
133
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
465k
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
465k
    } else {
519
465k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
465k
        ss->id = operator_id();
521
465k
        for (auto& dest : dests_id()) {
522
458k
            ss->related_op_ids.insert(dest);
523
458k
        }
524
465k
        return ss;
525
465k
    }
526
465k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.92k
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.92k
    } else {
519
6.92k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.92k
        ss->id = operator_id();
521
6.92k
        for (auto& dest : dests_id()) {
522
6.90k
            ss->related_op_ids.insert(dest);
523
6.90k
        }
524
6.92k
        return ss;
525
6.92k
    }
526
6.92k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
652
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
652
    } else {
519
652
        auto ss = LocalStateType::SharedStateType::create_shared();
520
652
        ss->id = operator_id();
521
653
        for (auto& dest : dests_id()) {
522
653
            ss->related_op_ids.insert(dest);
523
653
        }
524
652
        return ss;
525
652
    }
526
652
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.69k
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.69k
    } else {
519
2.69k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.69k
        ss->id = operator_id();
521
2.69k
        for (auto& dest : dests_id()) {
522
2.69k
            ss->related_op_ids.insert(dest);
523
2.69k
        }
524
2.69k
        return ss;
525
2.69k
    }
526
2.69k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.54k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.54k
    } else {
519
2.54k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.54k
        ss->id = operator_id();
521
2.55k
        for (auto& dest : dests_id()) {
522
2.55k
            ss->related_op_ids.insert(dest);
523
2.55k
        }
524
2.54k
        return ss;
525
2.54k
    }
526
2.54k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
567
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
567
    } else {
519
567
        auto ss = LocalStateType::SharedStateType::create_shared();
520
567
        ss->id = operator_id();
521
567
        for (auto& dest : dests_id()) {
522
561
            ss->related_op_ids.insert(dest);
523
561
        }
524
567
        return ss;
525
567
    }
526
567
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
106
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
106
    } else {
519
106
        auto ss = LocalStateType::SharedStateType::create_shared();
520
106
        ss->id = operator_id();
521
106
        for (auto& dest : dests_id()) {
522
106
            ss->related_op_ids.insert(dest);
523
106
        }
524
106
        return ss;
525
106
    }
526
106
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.86M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.86M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.86M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.86M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.86M
    return Status::OK();
534
1.86M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
68.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
68.6k
    auto local_state = LocalStateType::create_unique(state, this);
531
68.6k
    RETURN_IF_ERROR(local_state->init(state, info));
532
68.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
68.6k
    return Status::OK();
534
68.6k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
238k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
238k
    auto local_state = LocalStateType::create_unique(state, this);
531
238k
    RETURN_IF_ERROR(local_state->init(state, info));
532
238k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
238k
    return Status::OK();
534
238k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
135
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
135
    auto local_state = LocalStateType::create_unique(state, this);
531
135
    RETURN_IF_ERROR(local_state->init(state, info));
532
135
    state->emplace_local_state(operator_id(), std::move(local_state));
533
135
    return Status::OK();
534
135
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.09k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.09k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.09k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.09k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.09k
    return Status::OK();
534
3.09k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.41k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.41k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.41k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.41k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.41k
    return Status::OK();
534
8.41k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.33k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.33k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.33k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.33k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.33k
    return Status::OK();
534
8.33k
}
_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
189k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
189k
    auto local_state = LocalStateType::create_unique(state, this);
531
189k
    RETURN_IF_ERROR(local_state->init(state, info));
532
189k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
189k
    return Status::OK();
534
189k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
89.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
89.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
89.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
89.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
89.0k
    return Status::OK();
534
89.0k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
59.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
59.2k
    auto local_state = LocalStateType::create_unique(state, this);
531
59.2k
    RETURN_IF_ERROR(local_state->init(state, info));
532
59.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
59.2k
    return Status::OK();
534
59.2k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
124
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
124
    auto local_state = LocalStateType::create_unique(state, this);
531
124
    RETURN_IF_ERROR(local_state->init(state, info));
532
124
    state->emplace_local_state(operator_id(), std::move(local_state));
533
124
    return Status::OK();
534
124
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.97k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.97k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.97k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.97k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.97k
    return Status::OK();
534
4.97k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
262k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
262k
    auto local_state = LocalStateType::create_unique(state, this);
531
262k
    RETURN_IF_ERROR(local_state->init(state, info));
532
262k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
262k
    return Status::OK();
534
262k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
936
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
936
    auto local_state = LocalStateType::create_unique(state, this);
531
936
    RETURN_IF_ERROR(local_state->init(state, info));
532
936
    state->emplace_local_state(operator_id(), std::move(local_state));
533
936
    return Status::OK();
534
936
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.78k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.78k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.78k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.78k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.78k
    return Status::OK();
534
6.78k
}
_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.9k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.9k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.9k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.9k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.9k
    return Status::OK();
534
54.9k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.86k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.86k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.86k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.86k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.86k
    return Status::OK();
534
4.86k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
538
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
538
    auto local_state = LocalStateType::create_unique(state, this);
531
538
    RETURN_IF_ERROR(local_state->init(state, info));
532
538
    state->emplace_local_state(operator_id(), std::move(local_state));
533
538
    return Status::OK();
534
538
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.72k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.72k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.72k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.72k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.72k
    return Status::OK();
534
2.72k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.57k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.57k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.57k
    return Status::OK();
534
2.57k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
326
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
326
    auto local_state = LocalStateType::create_unique(state, this);
531
326
    RETURN_IF_ERROR(local_state->init(state, info));
532
326
    state->emplace_local_state(operator_id(), std::move(local_state));
533
326
    return Status::OK();
534
326
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.3k
    return Status::OK();
534
10.3k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
574k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
574k
    auto local_state = LocalStateType::create_unique(state, this);
531
574k
    RETURN_IF_ERROR(local_state->init(state, info));
532
574k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
574k
    return Status::OK();
534
574k
}
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
787
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
787
    auto local_state = LocalStateType::create_unique(state, this);
531
787
    RETURN_IF_ERROR(local_state->init(state, info));
532
787
    state->emplace_local_state(operator_id(), std::move(local_state));
533
787
    return Status::OK();
534
787
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.09k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.09k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.09k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.09k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.09k
    return Status::OK();
534
1.09k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.55k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.55k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.55k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.55k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.55k
    return Status::OK();
534
7.55k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
254k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
254k
    auto local_state = LocalStateType::create_unique(state, this);
531
254k
    RETURN_IF_ERROR(local_state->init(state, info));
532
254k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
254k
    return Status::OK();
534
254k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.58M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.84M
        : _num_rows_returned(0),
542
1.84M
          _rows_returned_counter(nullptr),
543
1.84M
          _parent(parent),
544
1.84M
          _state(state),
545
1.84M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.86M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.86M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.86M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.86M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.86M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1.86M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.86M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.86M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.86M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.86M
    if constexpr (!is_fake_shared) {
560
1.07M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
642k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
642k
                                    .first.get()
563
642k
                                    ->template cast<SharedStateArg>();
564
565
642k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
642k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
642k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
642k
        } else if (info.shared_state) {
569
361k
            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
361k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
361k
            _dependency = _shared_state->create_source_dependency(
576
361k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
361k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
361k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
361k
        } else {
580
69.9k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
8.55k
                DCHECK(false);
582
8.55k
            }
583
69.9k
        }
584
1.07M
    }
585
586
1.86M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1.86M
    _rows_returned_counter =
591
1.86M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.86M
    _blocks_returned_counter =
593
1.86M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.86M
    _output_block_bytes_counter =
595
1.86M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.86M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.86M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.86M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.86M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.86M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.86M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.86M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.86M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.86M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.86M
    _memory_used_counter =
606
1.86M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.86M
    _common_profile->add_info_string("IsColocate",
608
1.86M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.86M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.86M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.86M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.86M
    return Status::OK();
613
1.86M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
68.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
68.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
68.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
68.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
68.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
68.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
68.4k
    _operator_profile->add_child(_common_profile.get(), true);
557
68.4k
    _operator_profile->add_child(_custom_profile.get(), true);
558
68.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
68.4k
    if constexpr (!is_fake_shared) {
560
68.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
14.9k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
14.9k
                                    .first.get()
563
14.9k
                                    ->template cast<SharedStateArg>();
564
565
14.9k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
14.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
14.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
53.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
52.6k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
52.6k
            _dependency = _shared_state->create_source_dependency(
576
52.6k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
52.6k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
52.6k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
52.6k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
833
        }
584
68.4k
    }
585
586
68.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
68.4k
    _rows_returned_counter =
591
68.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
68.4k
    _blocks_returned_counter =
593
68.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
68.4k
    _output_block_bytes_counter =
595
68.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
68.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
68.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
68.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
68.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
68.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
68.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
68.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
68.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
68.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
68.4k
    _memory_used_counter =
606
68.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
68.4k
    _common_profile->add_info_string("IsColocate",
608
68.4k
                                     std::to_string(_parent->is_colocated_operator()));
609
68.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
68.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
68.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
68.4k
    return Status::OK();
613
68.4k
}
_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
198k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
198k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
198k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
198k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
198k
    _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
198k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
198k
    _operator_profile->add_child(_common_profile.get(), true);
557
198k
    _operator_profile->add_child(_custom_profile.get(), true);
558
198k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
198k
    if constexpr (!is_fake_shared) {
560
198k
        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
198k
        } 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
190k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
190k
            _dependency = _shared_state->create_source_dependency(
576
190k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
190k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
190k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
190k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
8.06k
        }
584
198k
    }
585
586
198k
    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
198k
    _rows_returned_counter =
591
198k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
198k
    _blocks_returned_counter =
593
198k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
198k
    _output_block_bytes_counter =
595
198k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
198k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
198k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
198k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
198k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
198k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
198k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
198k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
198k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
198k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
198k
    _memory_used_counter =
606
198k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
198k
    _common_profile->add_info_string("IsColocate",
608
198k
                                     std::to_string(_parent->is_colocated_operator()));
609
198k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
198k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
198k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
198k
    return Status::OK();
613
198k
}
_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
23
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
23
            _dependency = _shared_state->create_source_dependency(
576
23
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
23
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
23
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
23
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
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.81k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.81k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.81k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.81k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.81k
    _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.81k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.81k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.81k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.81k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.81k
    if constexpr (!is_fake_shared) {
560
6.81k
        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.81k
        } 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.59k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.59k
            _dependency = _shared_state->create_source_dependency(
576
6.59k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.59k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.59k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.59k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
218
        }
584
6.81k
    }
585
586
6.81k
    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.81k
    _rows_returned_counter =
591
6.81k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.81k
    _blocks_returned_counter =
593
6.81k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.81k
    _output_block_bytes_counter =
595
6.81k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.81k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.81k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.81k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.81k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.81k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.81k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.81k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.81k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.81k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.81k
    _memory_used_counter =
606
6.81k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.81k
    _common_profile->add_info_string("IsColocate",
608
6.81k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.81k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.81k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.81k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.81k
    return Status::OK();
613
6.81k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.49k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.49k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.49k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.49k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.49k
    _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.49k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.49k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.49k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.49k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.49k
    if constexpr (!is_fake_shared) {
560
8.49k
        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.49k
        } 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.40k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.40k
            _dependency = _shared_state->create_source_dependency(
576
8.40k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.40k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.40k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.40k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
92
        }
584
8.49k
    }
585
586
8.49k
    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.49k
    _rows_returned_counter =
591
8.49k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.49k
    _blocks_returned_counter =
593
8.49k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.49k
    _output_block_bytes_counter =
595
8.49k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.49k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.49k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.49k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.49k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.49k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.49k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.49k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.49k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.49k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.49k
    _memory_used_counter =
606
8.49k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.49k
    _common_profile->add_info_string("IsColocate",
608
8.49k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.49k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.49k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.49k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.49k
    return Status::OK();
613
8.49k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
89.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
89.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
89.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
89.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
89.3k
    _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.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
89.3k
    _operator_profile->add_child(_common_profile.get(), true);
557
89.3k
    _operator_profile->add_child(_custom_profile.get(), true);
558
89.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
89.3k
    if constexpr (!is_fake_shared) {
560
89.3k
        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.3k
        } 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
87.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
87.8k
            _dependency = _shared_state->create_source_dependency(
576
87.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
87.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
87.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
87.8k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.50k
        }
584
89.3k
    }
585
586
89.3k
    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.3k
    _rows_returned_counter =
591
89.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
89.3k
    _blocks_returned_counter =
593
89.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
89.3k
    _output_block_bytes_counter =
595
89.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
89.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
89.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
89.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
89.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
89.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
89.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
89.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
89.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
89.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
89.3k
    _memory_used_counter =
606
89.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
89.3k
    _common_profile->add_info_string("IsColocate",
608
89.3k
                                     std::to_string(_parent->is_colocated_operator()));
609
89.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
89.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
89.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
89.3k
    return Status::OK();
613
89.3k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
59.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
59.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
59.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
59.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
59.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
59.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
59.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
59.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
59.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
59.2k
    if constexpr (!is_fake_shared) {
560
59.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
59.1k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
59.1k
                                    .first.get()
563
59.1k
                                    ->template cast<SharedStateArg>();
564
565
59.1k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
59.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
59.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
59.1k
        } 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
23
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
23
        }
584
59.2k
    }
585
586
59.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
59.2k
    _rows_returned_counter =
591
59.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
59.2k
    _blocks_returned_counter =
593
59.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
59.2k
    _output_block_bytes_counter =
595
59.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
59.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
59.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
59.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
59.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
59.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
59.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
59.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
59.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
59.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
59.2k
    _memory_used_counter =
606
59.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
59.2k
    _common_profile->add_info_string("IsColocate",
608
59.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
59.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
59.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
59.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
59.2k
    return Status::OK();
613
59.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
124
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
124
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
124
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
124
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
124
    _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
124
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
124
    _operator_profile->add_child(_common_profile.get(), true);
557
124
    _operator_profile->add_child(_custom_profile.get(), true);
558
124
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
124
    if constexpr (!is_fake_shared) {
560
124
        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
124
        } 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
124
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
124
            _dependency = _shared_state->create_source_dependency(
576
124
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
124
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
124
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
124
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
124
    }
585
586
124
    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
124
    _rows_returned_counter =
591
124
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
124
    _blocks_returned_counter =
593
124
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
124
    _output_block_bytes_counter =
595
124
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
124
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
124
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
124
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
124
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
124
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
124
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
124
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
124
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
124
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
124
    _memory_used_counter =
606
124
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
124
    _common_profile->add_info_string("IsColocate",
608
124
                                     std::to_string(_parent->is_colocated_operator()));
609
124
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
124
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
124
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
124
    return Status::OK();
613
124
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
787k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
787k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
787k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
787k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
787k
    _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
787k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
787k
    _operator_profile->add_child(_common_profile.get(), true);
557
787k
    _operator_profile->add_child(_custom_profile.get(), true);
558
787k
    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
787k
    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
787k
    _rows_returned_counter =
591
787k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
787k
    _blocks_returned_counter =
593
787k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
787k
    _output_block_bytes_counter =
595
787k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
787k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
787k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
787k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
787k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
787k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
787k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
787k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
787k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
787k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
787k
    _memory_used_counter =
606
787k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
787k
    _common_profile->add_info_string("IsColocate",
608
787k
                                     std::to_string(_parent->is_colocated_operator()));
609
787k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
787k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
787k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
787k
    return Status::OK();
613
787k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.8k
    _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.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.8k
    if constexpr (!is_fake_shared) {
560
54.8k
        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.8k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.29k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.29k
            _dependency = _shared_state->create_source_dependency(
576
4.29k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.29k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.29k
                    _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.8k
    }
585
586
54.8k
    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.8k
    _rows_returned_counter =
591
54.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.8k
    _blocks_returned_counter =
593
54.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.8k
    _output_block_bytes_counter =
595
54.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.8k
    _memory_used_counter =
606
54.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.8k
    _common_profile->add_info_string("IsColocate",
608
54.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.8k
    return Status::OK();
613
54.8k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
4.87k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
4.87k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
4.87k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
4.87k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
4.87k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
4.87k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
4.87k
    _operator_profile->add_child(_common_profile.get(), true);
557
4.87k
    _operator_profile->add_child(_custom_profile.get(), true);
558
4.87k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
4.87k
    if constexpr (!is_fake_shared) {
560
4.87k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
4.87k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.85k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.85k
            _dependency = _shared_state->create_source_dependency(
576
4.85k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.85k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.85k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.85k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
28
        }
584
4.87k
    }
585
586
4.87k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
4.87k
    _rows_returned_counter =
591
4.87k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
4.87k
    _blocks_returned_counter =
593
4.87k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
4.87k
    _output_block_bytes_counter =
595
4.87k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
4.87k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
4.87k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
4.87k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
4.87k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
4.87k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
4.87k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
4.87k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
4.87k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
4.87k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
4.87k
    _memory_used_counter =
606
4.87k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
4.87k
    _common_profile->add_info_string("IsColocate",
608
4.87k
                                     std::to_string(_parent->is_colocated_operator()));
609
4.87k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
4.87k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
4.87k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
4.87k
    return Status::OK();
613
4.87k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
650
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
650
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
650
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
650
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
650
    _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
650
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
650
    _operator_profile->add_child(_common_profile.get(), true);
557
650
    _operator_profile->add_child(_custom_profile.get(), true);
558
650
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
650
    if constexpr (!is_fake_shared) {
560
650
        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
650
        } 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
649
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
649
            _dependency = _shared_state->create_source_dependency(
576
649
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
649
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
649
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
649
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
650
    }
585
586
650
    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
650
    _rows_returned_counter =
591
650
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
650
    _blocks_returned_counter =
593
650
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
650
    _output_block_bytes_counter =
595
650
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
650
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
650
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
650
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
650
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
650
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
650
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
650
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
650
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
650
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
650
    _memory_used_counter =
606
650
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
650
    _common_profile->add_info_string("IsColocate",
608
650
                                     std::to_string(_parent->is_colocated_operator()));
609
650
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
650
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
650
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
650
    return Status::OK();
613
650
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.32k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.32k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.32k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.32k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.32k
    _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.32k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.32k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.32k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.32k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.32k
    if constexpr (!is_fake_shared) {
560
5.32k
        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.32k
        } 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.28k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.28k
            _dependency = _shared_state->create_source_dependency(
576
5.28k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.28k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.28k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.28k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
48
        }
584
5.32k
    }
585
586
5.32k
    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.32k
    _rows_returned_counter =
591
5.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.32k
    _blocks_returned_counter =
593
5.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.32k
    _output_block_bytes_counter =
595
5.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.32k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.32k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.32k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.32k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.32k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.32k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.32k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.32k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.32k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.32k
    _memory_used_counter =
606
5.32k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.32k
    _common_profile->add_info_string("IsColocate",
608
5.32k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.32k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.32k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.32k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.32k
    return Status::OK();
613
5.32k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
576k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
576k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
576k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
576k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
576k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
576k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
576k
    _operator_profile->add_child(_common_profile.get(), true);
557
576k
    _operator_profile->add_child(_custom_profile.get(), true);
558
576k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
576k
    if constexpr (!is_fake_shared) {
560
576k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
568k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
568k
                                    .first.get()
563
568k
                                    ->template cast<SharedStateArg>();
564
565
568k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
568k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
568k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
568k
        } 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
8.55k
        } else {
580
8.55k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
8.55k
                DCHECK(false);
582
8.55k
            }
583
8.55k
        }
584
576k
    }
585
586
576k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
576k
    _rows_returned_counter =
591
576k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
576k
    _blocks_returned_counter =
593
576k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
576k
    _output_block_bytes_counter =
595
576k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
576k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
576k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
576k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
576k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
576k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
576k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
576k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
576k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
576k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
576k
    _memory_used_counter =
606
576k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
576k
    _common_profile->add_info_string("IsColocate",
608
576k
                                     std::to_string(_parent->is_colocated_operator()));
609
576k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
576k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
576k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
576k
    return Status::OK();
613
576k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
169
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
169
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
169
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
169
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
169
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
169
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
169
    _operator_profile->add_child(_common_profile.get(), true);
557
169
    _operator_profile->add_child(_custom_profile.get(), true);
558
169
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
169
    if constexpr (!is_fake_shared) {
560
169
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
169
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
169
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
169
            _dependency = _shared_state->create_source_dependency(
576
169
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
169
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
169
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
169
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
169
    }
585
586
169
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
169
    _rows_returned_counter =
591
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
169
    _blocks_returned_counter =
593
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
169
    _output_block_bytes_counter =
595
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
169
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
169
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
169
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
169
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
169
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
169
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
169
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
169
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
169
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
169
    _memory_used_counter =
606
169
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
169
    _common_profile->add_info_string("IsColocate",
608
169
                                     std::to_string(_parent->is_colocated_operator()));
609
169
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
169
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
169
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
169
    return Status::OK();
613
169
}
614
615
template <typename SharedStateArg>
616
1.87M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.87M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.17M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
300k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
300k
    }
621
1.87M
    if (_parent->has_projection()) {
622
378k
        const auto& projection = *_parent->_projection;
623
378k
        _projections.resize(projection.projections.size());
624
2.35M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.98M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.98M
        }
627
378k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
392k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
14.8k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
204k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
190k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
190k
                        state, _intermediate_projections[i][j]));
633
190k
            }
634
14.8k
        }
635
378k
    }
636
1.87M
    return Status::OK();
637
1.87M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
69.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
69.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
71.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.73k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.73k
    }
621
69.3k
    if (_parent->has_projection()) {
622
69.3k
        const auto& projection = *_parent->_projection;
623
69.3k
        _projections.resize(projection.projections.size());
624
377k
        for (size_t i = 0; i < _projections.size(); i++) {
625
307k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
307k
        }
627
69.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
76.0k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.74k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
152k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
146k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
146k
                        state, _intermediate_projections[i][j]));
633
146k
            }
634
6.74k
        }
635
69.3k
    }
636
69.3k
    return Status::OK();
637
69.3k
}
_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
200k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
200k
    _conjuncts.resize(_parent->_conjuncts.size());
618
200k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
200k
    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
200k
    return Status::OK();
637
200k
}
_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.97k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.97k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.12k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
152
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
152
    }
621
6.97k
    if (_parent->has_projection()) {
622
6.97k
        const auto& projection = *_parent->_projection;
623
6.97k
        _projections.resize(projection.projections.size());
624
31.4k
        for (size_t i = 0; i < _projections.size(); i++) {
625
24.4k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
24.4k
        }
627
6.97k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
7.02k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
48
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
327
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
279
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
279
                        state, _intermediate_projections[i][j]));
633
279
            }
634
48
        }
635
6.97k
    }
636
6.97k
    return Status::OK();
637
6.97k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.53k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.53k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.44k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
911
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
911
    }
621
8.53k
    if (_parent->has_projection()) {
622
4.97k
        const auto& projection = *_parent->_projection;
623
4.97k
        _projections.resize(projection.projections.size());
624
19.7k
        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.97k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.06k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
95
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
720
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
625
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
625
                        state, _intermediate_projections[i][j]));
633
625
            }
634
95
        }
635
4.97k
    }
636
8.53k
    return Status::OK();
637
8.53k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
89.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
89.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
91.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.40k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.40k
    }
621
89.6k
    if (_parent->has_projection()) {
622
30.2k
        const auto& projection = *_parent->_projection;
623
30.2k
        _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.2k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
30.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
224
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.67k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
1.45k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
1.45k
                        state, _intermediate_projections[i][j]));
633
1.45k
            }
634
224
        }
635
30.2k
    }
636
89.6k
    return Status::OK();
637
89.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
59.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
59.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
59.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
15
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
15
    }
621
59.3k
    if (_parent->has_projection()) {
622
169
        const auto& projection = *_parent->_projection;
623
169
        _projections.resize(projection.projections.size());
624
664
        for (size_t i = 0; i < _projections.size(); i++) {
625
495
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
495
        }
627
169
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        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
169
    }
636
59.3k
    return Status::OK();
637
59.3k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
128
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
128
    _conjuncts.resize(_parent->_conjuncts.size());
618
128
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
128
    if (_parent->has_projection()) {
622
112
        const auto& projection = *_parent->_projection;
623
112
        _projections.resize(projection.projections.size());
624
336
        for (size_t i = 0; i < _projections.size(); i++) {
625
224
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
224
        }
627
112
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
112
        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
112
    }
636
128
    return Status::OK();
637
128
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
793k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
793k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.08M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
295k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
295k
    }
621
793k
    if (_parent->has_projection()) {
622
254k
        const auto& projection = *_parent->_projection;
623
254k
        _projections.resize(projection.projections.size());
624
1.54M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.28M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.28M
        }
627
254k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
262k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.50k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
45.5k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
38.0k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
38.0k
                        state, _intermediate_projections[i][j]));
633
38.0k
            }
634
7.50k
        }
635
254k
    }
636
793k
    return Status::OK();
637
793k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
55.1k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
55.1k
    _conjuncts.resize(_parent->_conjuncts.size());
618
55.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
55.1k
    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.5k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
99.5k
        }
627
11.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
191
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3.91k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3.72k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3.72k
                        state, _intermediate_projections[i][j]));
633
3.72k
            }
634
191
        }
635
11.4k
    }
636
55.1k
    return Status::OK();
637
55.1k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
4.87k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
4.87k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.43k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
556
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
556
    }
621
4.87k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
4.87k
    return Status::OK();
637
4.87k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
655
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
655
    _conjuncts.resize(_parent->_conjuncts.size());
618
655
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
655
    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
655
    return Status::OK();
637
655
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.32k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.32k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.32k
    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.32k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
227
        for (size_t i = 0; i < _projections.size(); i++) {
625
167
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
167
        }
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.32k
    return Status::OK();
637
5.32k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
581k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
581k
    _conjuncts.resize(_parent->_conjuncts.size());
618
581k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
581k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
581k
    return Status::OK();
637
581k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
169
    _conjuncts.resize(_parent->_conjuncts.size());
618
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
169
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
491
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
166
    }
636
169
    return Status::OK();
637
169
}
638
639
template <typename SharedStateArg>
640
7.54k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.54k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
7.53k
    _terminated = true;
645
7.53k
    return Status::OK();
646
7.54k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
392
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
392
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
392
    _terminated = true;
645
392
    return Status::OK();
646
392
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
27
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
27
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
27
    _terminated = true;
645
27
    return Status::OK();
646
27
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
23
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
23
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
23
    _terminated = true;
645
23
    return Status::OK();
646
23
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
97
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
97
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
97
    _terminated = true;
645
97
    return Status::OK();
646
97
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1
    _terminated = true;
645
1
    return Status::OK();
646
1
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
5.63k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5.63k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
5.63k
    _terminated = true;
645
5.63k
    return Status::OK();
646
5.63k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
53
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
53
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
53
    _terminated = true;
645
53
    return Status::OK();
646
53
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
2
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
2
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
2
    _terminated = true;
645
2
    return Status::OK();
646
2
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
3
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
3
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
3
    _terminated = true;
645
3
    return Status::OK();
646
3
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.27k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.27k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
1.27k
    _terminated = true;
645
1.27k
    return Status::OK();
646
1.27k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
35
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
35
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
35
    _terminated = true;
645
35
    return Status::OK();
646
35
}
647
648
template <typename SharedStateArg>
649
2.10M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.10M
    if (_closed) {
651
229k
        return Status::OK();
652
229k
    }
653
1.87M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.07M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.07M
    }
656
1.87M
    _closed = true;
657
1.87M
    return Status::OK();
658
2.10M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
69.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
69.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
69.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
69.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
69.2k
    }
656
69.2k
    _closed = true;
657
69.2k
    return Status::OK();
658
69.2k
}
_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
396k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
396k
    if (_closed) {
651
199k
        return Status::OK();
652
199k
    }
653
197k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
197k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
197k
    }
656
197k
    _closed = true;
657
197k
    return Status::OK();
658
396k
}
_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.97k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.97k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.97k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.97k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.97k
    }
656
6.97k
    _closed = true;
657
6.97k
    return Status::OK();
658
6.97k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
17.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
17.1k
    if (_closed) {
651
8.68k
        return Status::OK();
652
8.68k
    }
653
8.49k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.49k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.49k
    }
656
8.49k
    _closed = true;
657
8.49k
    return Status::OK();
658
17.1k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
89.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
89.3k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
89.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
89.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
89.3k
    }
656
89.3k
    _closed = true;
657
89.3k
    return Status::OK();
658
89.3k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
58.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
58.9k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
58.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
58.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
58.9k
    }
656
58.9k
    _closed = true;
657
58.9k
    return Status::OK();
658
58.9k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
123
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
123
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
123
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
123
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
123
    }
656
123
    _closed = true;
657
123
    return Status::OK();
658
123
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
809k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
809k
    if (_closed) {
651
15.3k
        return Status::OK();
652
15.3k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
793k
    _closed = true;
657
793k
    return Status::OK();
658
809k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
55.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
55.1k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
55.1k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
55.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
55.1k
    }
656
55.1k
    _closed = true;
657
55.1k
    return Status::OK();
658
55.1k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4.85k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4.85k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4.85k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4.85k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4.85k
    }
656
4.85k
    _closed = true;
657
4.85k
    return Status::OK();
658
4.85k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
1.10k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
1.10k
    if (_closed) {
651
551
        return Status::OK();
652
551
    }
653
549
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
549
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
549
    }
656
549
    _closed = true;
657
549
    return Status::OK();
658
1.10k
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.8k
    if (_closed) {
651
5.56k
        return Status::OK();
652
5.56k
    }
653
5.32k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.32k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.32k
    }
656
5.32k
    _closed = true;
657
5.32k
    return Status::OK();
658
10.8k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
582k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
582k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
582k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
582k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
582k
    }
656
582k
    _closed = true;
657
582k
    return Status::OK();
658
582k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
334
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
334
    if (_closed) {
651
174
        return Status::OK();
652
174
    }
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
334
}
659
660
template <typename SharedState>
661
1.58M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.58M
    _operator_profile =
664
1.58M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.58M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.58M
    _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.58M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.58M
    _operator_profile->add_child(_common_profile, true);
673
1.58M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.58M
    _operator_profile->set_metadata(_parent->node_id());
676
1.58M
    _wait_for_finish_dependency_timer =
677
1.58M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.58M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.58M
    if constexpr (!is_fake_shared) {
680
1.12M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.12M
            info.shared_state_map.end()) {
682
308k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
233k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
233k
            }
685
308k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
308k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
308k
                                                  ? 0
688
308k
                                                  : info.task_idx]
689
308k
                                  .get();
690
308k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
816k
        } else {
692
816k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
270
                DCHECK(false);
694
270
            }
695
816k
            _shared_state = info.shared_state->template cast<SharedState>();
696
816k
            _dependency = _shared_state->create_sink_dependency(
697
816k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
816k
        }
699
1.12M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.12M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.12M
    }
702
703
1.58M
    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.58M
    _rows_input_counter =
708
1.58M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.58M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.58M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.58M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.58M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.58M
    _memory_used_counter =
714
1.58M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.58M
    _common_profile->add_info_string("IsColocate",
716
1.58M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.58M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.58M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.58M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.58M
    return Status::OK();
721
1.58M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
117k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
117k
    _operator_profile =
664
117k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
117k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
117k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
117k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
117k
    _operator_profile->add_child(_common_profile, true);
673
117k
    _operator_profile->add_child(_custom_profile, true);
674
675
117k
    _operator_profile->set_metadata(_parent->node_id());
676
117k
    _wait_for_finish_dependency_timer =
677
117k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
117k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
117k
    if constexpr (!is_fake_shared) {
680
117k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
117k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
15.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
15.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
15.5k
                                                  ? 0
688
15.5k
                                                  : info.task_idx]
689
15.5k
                                  .get();
690
15.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
101k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
101k
            _shared_state = info.shared_state->template cast<SharedState>();
696
101k
            _dependency = _shared_state->create_sink_dependency(
697
101k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
101k
        }
699
117k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
117k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
117k
    }
702
703
117k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
117k
    _rows_input_counter =
708
117k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
117k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
117k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
117k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
117k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
117k
    _memory_used_counter =
714
117k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
117k
    _common_profile->add_info_string("IsColocate",
716
117k
                                     std::to_string(_parent->is_colocated_operator()));
717
117k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
117k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
117k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
117k
    return Status::OK();
721
117k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2
    _operator_profile =
664
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2
    _operator_profile->add_child(_common_profile, true);
673
2
    _operator_profile->add_child(_custom_profile, true);
674
675
2
    _operator_profile->set_metadata(_parent->node_id());
676
2
    _wait_for_finish_dependency_timer =
677
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2
    if constexpr (!is_fake_shared) {
680
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2
            _shared_state = info.shared_state->template cast<SharedState>();
696
2
            _dependency = _shared_state->create_sink_dependency(
697
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2
        }
699
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2
    }
702
703
2
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2
    _rows_input_counter =
708
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2
    _memory_used_counter =
714
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2
    _common_profile->add_info_string("IsColocate",
716
2
                                     std::to_string(_parent->is_colocated_operator()));
717
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2
    return Status::OK();
721
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
199k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
199k
    _operator_profile =
664
199k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
199k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
199k
    _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
199k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
199k
    _operator_profile->add_child(_common_profile, true);
673
199k
    _operator_profile->add_child(_custom_profile, true);
674
675
199k
    _operator_profile->set_metadata(_parent->node_id());
676
199k
    _wait_for_finish_dependency_timer =
677
199k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
199k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
199k
    if constexpr (!is_fake_shared) {
680
199k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
199k
            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
199k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
199k
            _shared_state = info.shared_state->template cast<SharedState>();
696
199k
            _dependency = _shared_state->create_sink_dependency(
697
199k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
199k
        }
699
199k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
199k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
199k
    }
702
703
199k
    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
199k
    _rows_input_counter =
708
199k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
199k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
199k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
199k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
199k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
199k
    _memory_used_counter =
714
199k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
199k
    _common_profile->add_info_string("IsColocate",
716
199k
                                     std::to_string(_parent->is_colocated_operator()));
717
199k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
199k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
199k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
199k
    return Status::OK();
721
199k
}
_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.91k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.91k
    _operator_profile =
664
6.91k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.91k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.91k
    _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.91k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.91k
    _operator_profile->add_child(_common_profile, true);
673
6.91k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.91k
    _operator_profile->set_metadata(_parent->node_id());
676
6.91k
    _wait_for_finish_dependency_timer =
677
6.91k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.91k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.91k
    if constexpr (!is_fake_shared) {
680
6.91k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.91k
            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.91k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.91k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.91k
            _dependency = _shared_state->create_sink_dependency(
697
6.91k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.91k
        }
699
6.91k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.91k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.91k
    }
702
703
6.91k
    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.91k
    _rows_input_counter =
708
6.91k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.91k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.91k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.91k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.91k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.91k
    _memory_used_counter =
714
6.91k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.91k
    _common_profile->add_info_string("IsColocate",
716
6.91k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.91k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.91k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.91k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.91k
    return Status::OK();
721
6.91k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.50k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.50k
    _operator_profile =
664
8.50k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.50k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.50k
    _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.50k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.50k
    _operator_profile->add_child(_common_profile, true);
673
8.50k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.50k
    _operator_profile->set_metadata(_parent->node_id());
676
8.50k
    _wait_for_finish_dependency_timer =
677
8.50k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.50k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.50k
    if constexpr (!is_fake_shared) {
680
8.50k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.50k
            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.50k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.50k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.50k
            _dependency = _shared_state->create_sink_dependency(
697
8.50k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.50k
        }
699
8.50k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.50k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.50k
    }
702
703
8.50k
    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.50k
    _rows_input_counter =
708
8.50k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.50k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.50k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.50k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.50k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.50k
    _memory_used_counter =
714
8.50k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.50k
    _common_profile->add_info_string("IsColocate",
716
8.50k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.50k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.50k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.50k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.50k
    return Status::OK();
721
8.50k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
89.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
89.4k
    _operator_profile =
664
89.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
89.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
89.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
89.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
89.4k
    _operator_profile->add_child(_common_profile, true);
673
89.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
89.4k
    _operator_profile->set_metadata(_parent->node_id());
676
89.4k
    _wait_for_finish_dependency_timer =
677
89.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
89.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
89.4k
    if constexpr (!is_fake_shared) {
680
89.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
89.4k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
89.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
89.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
89.4k
            _dependency = _shared_state->create_sink_dependency(
697
89.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
89.4k
        }
699
89.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
89.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
89.4k
    }
702
703
89.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
89.4k
    _rows_input_counter =
708
89.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
89.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
89.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
89.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
89.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
89.4k
    _memory_used_counter =
714
89.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
89.4k
    _common_profile->add_info_string("IsColocate",
716
89.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
89.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
89.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
89.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
89.4k
    return Status::OK();
721
89.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
59.2k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
59.2k
    _operator_profile =
664
59.2k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
59.2k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
59.2k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
59.2k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
59.2k
    _operator_profile->add_child(_common_profile, true);
673
59.2k
    _operator_profile->add_child(_custom_profile, true);
674
675
59.2k
    _operator_profile->set_metadata(_parent->node_id());
676
59.2k
    _wait_for_finish_dependency_timer =
677
59.2k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
59.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
59.2k
    if constexpr (!is_fake_shared) {
680
59.2k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
59.2k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
59.2k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
59.2k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
59.2k
                                                  ? 0
688
59.2k
                                                  : info.task_idx]
689
59.2k
                                  .get();
690
59.2k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
59.2k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
59.2k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
59.2k
    }
702
703
59.2k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
59.2k
    _rows_input_counter =
708
59.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
59.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
59.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
59.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
59.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
59.2k
    _memory_used_counter =
714
59.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
59.2k
    _common_profile->add_info_string("IsColocate",
716
59.2k
                                     std::to_string(_parent->is_colocated_operator()));
717
59.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
59.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
59.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
59.2k
    return Status::OK();
721
59.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
134
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
134
    _operator_profile =
664
134
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
134
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
134
    _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
134
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
134
    _operator_profile->add_child(_common_profile, true);
673
134
    _operator_profile->add_child(_custom_profile, true);
674
675
134
    _operator_profile->set_metadata(_parent->node_id());
676
134
    _wait_for_finish_dependency_timer =
677
134
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
134
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
134
    if constexpr (!is_fake_shared) {
680
134
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
134
            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
134
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
134
            _shared_state = info.shared_state->template cast<SharedState>();
696
134
            _dependency = _shared_state->create_sink_dependency(
697
134
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
134
        }
699
134
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
134
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
134
    }
702
703
134
    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
134
    _rows_input_counter =
708
134
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
134
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
134
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
134
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
134
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
134
    _memory_used_counter =
714
134
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
134
    _common_profile->add_info_string("IsColocate",
716
134
                                     std::to_string(_parent->is_colocated_operator()));
717
134
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
134
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
134
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
134
    return Status::OK();
721
134
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
464k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
464k
    _operator_profile =
664
464k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
464k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
464k
    _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
464k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
464k
    _operator_profile->add_child(_common_profile, true);
673
464k
    _operator_profile->add_child(_custom_profile, true);
674
675
464k
    _operator_profile->set_metadata(_parent->node_id());
676
464k
    _wait_for_finish_dependency_timer =
677
464k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
464k
    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
464k
    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
464k
    _rows_input_counter =
708
464k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
464k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
464k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
464k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
464k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
464k
    _memory_used_counter =
714
464k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
464k
    _common_profile->add_info_string("IsColocate",
716
464k
                                     std::to_string(_parent->is_colocated_operator()));
717
464k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
464k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
464k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
464k
    return Status::OK();
721
464k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
9.85k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
9.85k
    _operator_profile =
664
9.85k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
9.85k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
9.85k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
9.85k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
9.85k
    _operator_profile->add_child(_common_profile, true);
673
9.85k
    _operator_profile->add_child(_custom_profile, true);
674
675
9.85k
    _operator_profile->set_metadata(_parent->node_id());
676
9.85k
    _wait_for_finish_dependency_timer =
677
9.85k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
9.85k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
9.85k
    if constexpr (!is_fake_shared) {
680
9.85k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
9.85k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
9.85k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
9.85k
            _shared_state = info.shared_state->template cast<SharedState>();
696
9.85k
            _dependency = _shared_state->create_sink_dependency(
697
9.85k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
9.85k
        }
699
9.85k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
9.85k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
9.85k
    }
702
703
9.85k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
9.85k
    _rows_input_counter =
708
9.85k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
9.85k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
9.85k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
9.85k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
9.85k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
9.85k
    _memory_used_counter =
714
9.85k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
9.85k
    _common_profile->add_info_string("IsColocate",
716
9.85k
                                     std::to_string(_parent->is_colocated_operator()));
717
9.85k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
9.85k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
9.85k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
9.85k
    return Status::OK();
721
9.85k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
651
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
651
    _operator_profile =
664
651
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
651
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
651
    _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
651
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
651
    _operator_profile->add_child(_common_profile, true);
673
651
    _operator_profile->add_child(_custom_profile, true);
674
675
651
    _operator_profile->set_metadata(_parent->node_id());
676
651
    _wait_for_finish_dependency_timer =
677
651
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
651
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
651
    if constexpr (!is_fake_shared) {
680
651
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
651
            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
651
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
651
            _shared_state = info.shared_state->template cast<SharedState>();
696
651
            _dependency = _shared_state->create_sink_dependency(
697
651
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
651
        }
699
651
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
651
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
651
    }
702
703
651
    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
651
    _rows_input_counter =
708
651
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
651
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
651
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
651
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
651
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
651
    _memory_used_counter =
714
651
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
651
    _common_profile->add_info_string("IsColocate",
716
651
                                     std::to_string(_parent->is_colocated_operator()));
717
651
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
651
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
651
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
651
    return Status::OK();
721
651
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
1.91k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.91k
    _operator_profile =
664
1.91k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.91k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.91k
    _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.91k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.91k
    _operator_profile->add_child(_common_profile, true);
673
1.91k
    _operator_profile->add_child(_custom_profile, true);
674
675
1.91k
    _operator_profile->set_metadata(_parent->node_id());
676
1.91k
    _wait_for_finish_dependency_timer =
677
1.91k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.91k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.91k
    if constexpr (!is_fake_shared) {
680
1.91k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.91k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
1.91k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
1.91k
            _shared_state = info.shared_state->template cast<SharedState>();
696
1.91k
            _dependency = _shared_state->create_sink_dependency(
697
1.91k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
1.91k
        }
699
1.91k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.91k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.91k
    }
702
703
1.91k
    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.91k
    _rows_input_counter =
708
1.91k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.91k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.91k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.91k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.91k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.91k
    _memory_used_counter =
714
1.91k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.91k
    _common_profile->add_info_string("IsColocate",
716
1.91k
                                     std::to_string(_parent->is_colocated_operator()));
717
1.91k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.91k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.91k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.91k
    return Status::OK();
721
1.91k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
13.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
13.1k
    _operator_profile =
664
13.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
13.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
13.1k
    _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.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
13.1k
    _operator_profile->add_child(_common_profile, true);
673
13.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
13.1k
    _operator_profile->set_metadata(_parent->node_id());
676
13.1k
    _wait_for_finish_dependency_timer =
677
13.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
13.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
13.1k
    if constexpr (!is_fake_shared) {
680
13.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
13.1k
            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.1k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
13.1k
            _shared_state = info.shared_state->template cast<SharedState>();
696
13.1k
            _dependency = _shared_state->create_sink_dependency(
697
13.1k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
13.1k
        }
699
13.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
13.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
13.1k
    }
702
703
13.1k
    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.1k
    _rows_input_counter =
708
13.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
13.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
13.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
13.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
13.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
13.1k
    _memory_used_counter =
714
13.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
13.1k
    _common_profile->add_info_string("IsColocate",
716
13.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
13.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
13.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
13.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
13.1k
    return Status::OK();
721
13.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
233k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
233k
    _operator_profile =
664
233k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
233k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
233k
    _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
233k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
233k
    _operator_profile->add_child(_common_profile, true);
673
233k
    _operator_profile->add_child(_custom_profile, true);
674
675
233k
    _operator_profile->set_metadata(_parent->node_id());
676
233k
    _wait_for_finish_dependency_timer =
677
233k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
233k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
233k
    if constexpr (!is_fake_shared) {
680
233k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
233k
            info.shared_state_map.end()) {
682
233k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
233k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
233k
            }
685
233k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
233k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
233k
                                                  ? 0
688
18.4E
                                                  : info.task_idx]
689
233k
                                  .get();
690
233k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
233k
        } else {
692
270
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
270
                DCHECK(false);
694
270
            }
695
270
            _shared_state = info.shared_state->template cast<SharedState>();
696
270
            _dependency = _shared_state->create_sink_dependency(
697
270
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
270
        }
699
233k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
233k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
233k
    }
702
703
233k
    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
233k
    _rows_input_counter =
708
233k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
233k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
233k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
233k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
233k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
233k
    _memory_used_counter =
714
233k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
233k
    _common_profile->add_info_string("IsColocate",
716
233k
                                     std::to_string(_parent->is_colocated_operator()));
717
233k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
233k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
233k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
233k
    return Status::OK();
721
233k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
385k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
385k
    _operator_profile =
664
385k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
385k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
385k
    _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
385k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
385k
    _operator_profile->add_child(_common_profile, true);
673
385k
    _operator_profile->add_child(_custom_profile, true);
674
675
385k
    _operator_profile->set_metadata(_parent->node_id());
676
385k
    _wait_for_finish_dependency_timer =
677
385k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
385k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
385k
    if constexpr (!is_fake_shared) {
680
385k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
385k
            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
385k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
385k
            _shared_state = info.shared_state->template cast<SharedState>();
696
385k
            _dependency = _shared_state->create_sink_dependency(
697
385k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
385k
        }
699
385k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
385k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
385k
    }
702
703
385k
    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
385k
    _rows_input_counter =
708
385k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
385k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
385k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
385k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
385k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
385k
    _memory_used_counter =
714
385k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
385k
    _common_profile->add_info_string("IsColocate",
716
385k
                                     std::to_string(_parent->is_colocated_operator()));
717
385k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
385k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
385k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
385k
    return Status::OK();
721
385k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
25
    _operator_profile =
664
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
25
    _operator_profile->add_child(_common_profile, true);
673
25
    _operator_profile->add_child(_custom_profile, true);
674
675
25
    _operator_profile->set_metadata(_parent->node_id());
676
25
    _wait_for_finish_dependency_timer =
677
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
25
    if constexpr (!is_fake_shared) {
680
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
25
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
25
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
25
            _shared_state = info.shared_state->template cast<SharedState>();
696
25
            _dependency = _shared_state->create_sink_dependency(
697
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
25
        }
699
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
25
    }
702
703
25
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
25
    _rows_input_counter =
708
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
25
    _memory_used_counter =
714
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
25
    _common_profile->add_info_string("IsColocate",
716
25
                                     std::to_string(_parent->is_colocated_operator()));
717
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
25
    return Status::OK();
721
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
338
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
338
    _operator_profile =
664
338
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
338
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
338
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
338
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
338
    _operator_profile->add_child(_common_profile, true);
673
338
    _operator_profile->add_child(_custom_profile, true);
674
675
338
    _operator_profile->set_metadata(_parent->node_id());
676
338
    _wait_for_finish_dependency_timer =
677
338
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
338
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
338
    if constexpr (!is_fake_shared) {
680
338
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
338
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
338
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
338
            _shared_state = info.shared_state->template cast<SharedState>();
696
338
            _dependency = _shared_state->create_sink_dependency(
697
338
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
338
        }
699
338
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
338
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
338
    }
702
703
338
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
338
    _rows_input_counter =
708
338
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
338
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
338
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
338
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
338
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
338
    _memory_used_counter =
714
338
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
338
    _common_profile->add_info_string("IsColocate",
716
338
                                     std::to_string(_parent->is_colocated_operator()));
717
338
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
338
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
338
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
338
    return Status::OK();
721
338
}
722
723
template <typename SharedState>
724
1.59M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.59M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.59M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.12M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.12M
    }
731
1.59M
    _closed = true;
732
1.59M
    return Status::OK();
733
1.59M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
117k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
117k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
117k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
117k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
117k
    }
731
117k
    _closed = true;
732
117k
    return Status::OK();
733
117k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1
    }
731
1
    _closed = true;
732
1
    return Status::OK();
733
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
199k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
199k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
199k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
199k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
199k
    }
731
199k
    _closed = true;
732
199k
    return Status::OK();
733
199k
}
_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.93k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.93k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.93k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.93k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.93k
    }
731
6.93k
    _closed = true;
732
6.93k
    return Status::OK();
733
6.93k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.47k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.47k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.47k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.47k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.47k
    }
731
8.47k
    _closed = true;
732
8.47k
    return Status::OK();
733
8.47k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
89.2k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
89.2k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
89.2k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
89.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
89.2k
    }
731
89.2k
    _closed = true;
732
89.2k
    return Status::OK();
733
89.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
59.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
59.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
59.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
59.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
59.0k
    }
731
59.0k
    _closed = true;
732
59.0k
    return Status::OK();
733
59.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
123
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
123
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
123
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
123
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
123
    }
731
123
    _closed = true;
732
123
    return Status::OK();
733
123
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
467k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
467k
    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
467k
    _closed = true;
732
467k
    return Status::OK();
733
467k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
9.88k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
9.88k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
9.88k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
9.88k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
9.88k
    }
731
9.88k
    _closed = true;
732
9.88k
    return Status::OK();
733
9.88k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
551
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
551
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
551
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
551
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
551
    }
731
551
    _closed = true;
732
551
    return Status::OK();
733
551
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1.95k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.95k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1.95k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.95k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.95k
    }
731
1.95k
    _closed = true;
732
1.95k
    return Status::OK();
733
1.95k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
13.1k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
13.1k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
13.1k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
13.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
13.1k
    }
731
13.1k
    _closed = true;
732
13.1k
    return Status::OK();
733
13.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_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_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
387k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
387k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
387k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
387k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
387k
    }
731
387k
    _closed = true;
732
387k
    return Status::OK();
733
387k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
14
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
14
    }
731
14
    _closed = true;
732
14
    return Status::OK();
733
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
338
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
338
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
338
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
338
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
338
    }
731
338
    _closed = true;
732
338
    return Status::OK();
733
338
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
7.29k
                                                          bool* eos) {
738
7.29k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.28k
    return pull(state, block, eos);
740
7.29k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
37
                                                          bool* eos) {
738
37
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
37
    return pull(state, block, eos);
740
37
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
7.25k
                                                          bool* eos) {
738
7.25k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.25k
    return pull(state, block, eos);
740
7.25k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
488k
                                                         bool* eos) {
745
488k
    auto& local_state = get_local_state(state);
746
488k
    if (need_more_input_data(state)) {
747
459k
        local_state._child_block->clear_column_data(
748
459k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
459k
                        .num_materialized_slots());
750
459k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
459k
                state, local_state._child_block.get(), &local_state._child_eos));
752
459k
        *eos = local_state._child_eos;
753
459k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
66.9k
            return Status::OK();
755
66.9k
        }
756
392k
        {
757
392k
            SCOPED_TIMER(local_state.exec_time_counter());
758
392k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
392k
        }
760
392k
    }
761
762
421k
    if (!need_more_input_data(state)) {
763
395k
        SCOPED_TIMER(local_state.exec_time_counter());
764
395k
        bool new_eos = false;
765
395k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
395k
        if (new_eos) {
767
321k
            *eos = true;
768
321k
        } else if (!need_more_input_data(state)) {
769
23.0k
            *eos = false;
770
23.0k
        }
771
395k
    }
772
421k
    return Status::OK();
773
421k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
139k
                                                         bool* eos) {
745
139k
    auto& local_state = get_local_state(state);
746
139k
    if (need_more_input_data(state)) {
747
121k
        local_state._child_block->clear_column_data(
748
121k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
121k
                        .num_materialized_slots());
750
121k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
121k
                state, local_state._child_block.get(), &local_state._child_eos));
752
121k
        *eos = local_state._child_eos;
753
121k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
40.2k
            return Status::OK();
755
40.2k
        }
756
81.3k
        {
757
81.3k
            SCOPED_TIMER(local_state.exec_time_counter());
758
81.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
81.3k
        }
760
81.3k
    }
761
762
99.1k
    if (!need_more_input_data(state)) {
763
99.1k
        SCOPED_TIMER(local_state.exec_time_counter());
764
99.1k
        bool new_eos = false;
765
99.1k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
99.1k
        if (new_eos) {
767
44.8k
            *eos = true;
768
54.3k
        } else if (!need_more_input_data(state)) {
769
10.3k
            *eos = false;
770
10.3k
        }
771
99.1k
    }
772
99.1k
    return Status::OK();
773
99.1k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.21k
                                                         bool* eos) {
745
4.21k
    auto& local_state = get_local_state(state);
746
4.21k
    if (need_more_input_data(state)) {
747
2.23k
        local_state._child_block->clear_column_data(
748
2.23k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.23k
                        .num_materialized_slots());
750
2.23k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.23k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.23k
        *eos = local_state._child_eos;
753
2.23k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
549
            return Status::OK();
755
549
        }
756
1.68k
        {
757
1.68k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.68k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.68k
        }
760
1.68k
    }
761
762
3.67k
    if (!need_more_input_data(state)) {
763
3.67k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.67k
        bool new_eos = false;
765
3.67k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.67k
        if (new_eos) {
767
952
            *eos = true;
768
2.72k
        } else if (!need_more_input_data(state)) {
769
1.98k
            *eos = false;
770
1.98k
        }
771
3.67k
    }
772
3.66k
    return Status::OK();
773
3.66k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.91k
                                                         bool* eos) {
745
1.91k
    auto& local_state = get_local_state(state);
746
1.91k
    if (need_more_input_data(state)) {
747
1.91k
        local_state._child_block->clear_column_data(
748
1.91k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.91k
                        .num_materialized_slots());
750
1.91k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.91k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.91k
        *eos = local_state._child_eos;
753
1.91k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
776
            return Status::OK();
755
776
        }
756
1.14k
        {
757
1.14k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.14k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.14k
        }
760
1.14k
    }
761
762
1.14k
    if (!need_more_input_data(state)) {
763
1.14k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.14k
        bool new_eos = false;
765
1.14k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.14k
        if (new_eos) {
767
787
            *eos = true;
768
787
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.14k
    }
772
1.14k
    return Status::OK();
773
1.14k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
20.3k
                                                         bool* eos) {
745
20.3k
    auto& local_state = get_local_state(state);
746
20.3k
    if (need_more_input_data(state)) {
747
20.3k
        local_state._child_block->clear_column_data(
748
20.3k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
20.3k
                        .num_materialized_slots());
750
20.3k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
20.3k
                state, local_state._child_block.get(), &local_state._child_eos));
752
20.3k
        *eos = local_state._child_eos;
753
20.3k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
5.64k
            return Status::OK();
755
5.64k
        }
756
14.6k
        {
757
14.6k
            SCOPED_TIMER(local_state.exec_time_counter());
758
14.6k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
14.6k
        }
760
14.6k
    }
761
762
14.6k
    if (!need_more_input_data(state)) {
763
7.57k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.57k
        bool new_eos = false;
765
7.57k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.57k
        if (new_eos) {
767
7.43k
            *eos = true;
768
7.43k
        } else if (!need_more_input_data(state)) {
769
11
            *eos = false;
770
11
        }
771
7.57k
    }
772
14.6k
    return Status::OK();
773
14.6k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
292k
                                                         bool* eos) {
745
292k
    auto& local_state = get_local_state(state);
746
293k
    if (need_more_input_data(state)) {
747
293k
        local_state._child_block->clear_column_data(
748
293k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
293k
                        .num_materialized_slots());
750
293k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
293k
                state, local_state._child_block.get(), &local_state._child_eos));
752
293k
        *eos = local_state._child_eos;
753
293k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
18.0k
            return Status::OK();
755
18.0k
        }
756
275k
        {
757
275k
            SCOPED_TIMER(local_state.exec_time_counter());
758
275k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
275k
        }
760
275k
    }
761
762
274k
    if (!need_more_input_data(state)) {
763
255k
        SCOPED_TIMER(local_state.exec_time_counter());
764
255k
        bool new_eos = false;
765
255k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
255k
        if (new_eos) {
767
255k
            *eos = true;
768
255k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
255k
    }
772
274k
    return Status::OK();
773
274k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
22.3k
                                                         bool* eos) {
745
22.3k
    auto& local_state = get_local_state(state);
746
22.3k
    if (need_more_input_data(state)) {
747
11.9k
        local_state._child_block->clear_column_data(
748
11.9k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
11.9k
                        .num_materialized_slots());
750
11.9k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
11.9k
                state, local_state._child_block.get(), &local_state._child_eos));
752
11.9k
        *eos = local_state._child_eos;
753
11.9k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
730
            return Status::OK();
755
730
        }
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
21.5k
    if (!need_more_input_data(state)) {
763
20.8k
        SCOPED_TIMER(local_state.exec_time_counter());
764
20.8k
        bool new_eos = false;
765
20.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
20.8k
        if (new_eos) {
767
6.89k
            *eos = true;
768
13.9k
        } else if (!need_more_input_data(state)) {
769
10.3k
            *eos = false;
770
10.3k
        }
771
20.8k
    }
772
21.5k
    return Status::OK();
773
21.5k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.91k
                                                         bool* eos) {
745
7.91k
    auto& local_state = get_local_state(state);
746
7.91k
    if (need_more_input_data(state)) {
747
7.55k
        local_state._child_block->clear_column_data(
748
7.55k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
7.55k
                        .num_materialized_slots());
750
7.55k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
7.55k
                state, local_state._child_block.get(), &local_state._child_eos));
752
7.55k
        *eos = local_state._child_eos;
753
7.55k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
894
            return Status::OK();
755
894
        }
756
6.66k
        {
757
6.66k
            SCOPED_TIMER(local_state.exec_time_counter());
758
6.66k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
6.66k
        }
760
6.66k
    }
761
762
7.02k
    if (!need_more_input_data(state)) {
763
7.02k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.02k
        bool new_eos = false;
765
7.02k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.02k
        if (new_eos) {
767
4.90k
            *eos = true;
768
4.90k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
7.02k
    }
772
7.01k
    return Status::OK();
773
7.01k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
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_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
360
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
360
    RETURN_IF_ERROR(Base::init(state, info));
779
360
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
360
                                                         "AsyncWriterDependency", true);
781
360
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
360
                             _finish_dependency));
783
784
360
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
360
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
360
    return Status::OK();
787
360
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
45.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
45.6k
    RETURN_IF_ERROR(Base::init(state, info));
779
45.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
45.6k
                                                         "AsyncWriterDependency", true);
781
45.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
45.6k
                             _finish_dependency));
783
784
45.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
45.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
45.6k
    return Status::OK();
787
45.6k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
30
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
30
    RETURN_IF_ERROR(Base::init(state, info));
779
30
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
30
                                                         "AsyncWriterDependency", true);
781
30
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
30
                             _finish_dependency));
783
784
30
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
30
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
30
    return Status::OK();
787
30
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
46.8k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.8k
    RETURN_IF_ERROR(Base::open(state));
793
46.8k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
363k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
316k
        RETURN_IF_ERROR(
796
316k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
316k
    }
798
46.8k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.8k
    return Status::OK();
800
46.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
360
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
360
    RETURN_IF_ERROR(Base::open(state));
793
360
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.86k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.50k
        RETURN_IF_ERROR(
796
1.50k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.50k
    }
798
360
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
360
    return Status::OK();
800
360
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
46.4k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.4k
    RETURN_IF_ERROR(Base::open(state));
793
46.4k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
361k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
314k
        RETURN_IF_ERROR(
796
314k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
314k
    }
798
46.4k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.4k
    return Status::OK();
800
46.4k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
30
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
30
    RETURN_IF_ERROR(Base::open(state));
793
30
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
540
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
510
        RETURN_IF_ERROR(
796
510
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
510
    }
798
30
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
30
    return Status::OK();
800
30
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
62.1k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.1k
    return _writer->sink(block, eos);
806
62.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.53k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.53k
    return _writer->sink(block, eos);
806
1.53k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
60.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
60.5k
    return _writer->sink(block, eos);
806
60.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
30
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
30
    return _writer->sink(block, eos);
806
30
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
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.9k
    if (_writer) {
818
46.9k
        Status st = _writer->get_writer_status();
819
46.9k
        if (exec_status.ok()) {
820
46.8k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
46.8k
                                                       : Status::Cancelled("force close"));
822
46.8k
        } else {
823
112
            _writer->force_close(exec_status);
824
112
        }
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.9k
        RETURN_IF_ERROR(st);
829
46.9k
    }
830
46.8k
    return Base::close(state, exec_status);
831
46.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
348
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
348
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
348
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
348
    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
348
    if (_writer) {
818
348
        Status st = _writer->get_writer_status();
819
348
        if (exec_status.ok()) {
820
348
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
348
                                                       : Status::Cancelled("force close"));
822
348
        } 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
348
        RETURN_IF_ERROR(st);
829
348
    }
830
348
    return Base::close(state, exec_status);
831
348
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
46.5k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
46.5k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
46.5k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
46.5k
    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.5k
    if (_writer) {
818
46.5k
        Status st = _writer->get_writer_status();
819
46.5k
        if (exec_status.ok()) {
820
46.4k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
46.4k
                                                       : Status::Cancelled("force close"));
822
46.4k
        } else {
823
112
            _writer->force_close(exec_status);
824
112
        }
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.5k
        RETURN_IF_ERROR(st);
829
46.5k
    }
830
46.4k
    return Base::close(state, exec_status);
831
46.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
30
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
30
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
30
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
30
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
30
    if (_writer) {
818
30
        Status st = _writer->get_writer_status();
819
30
        if (exec_status.ok()) {
820
30
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
30
                                                       : Status::Cancelled("force close"));
822
30
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
30
        RETURN_IF_ERROR(st);
829
30
    }
830
30
    return Base::close(state, exec_status);
831
30
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
832
833
// An instantiation added outside the macros below needs the matching
834
// 'extern template' declaration in the operator's header (enforced by
835
// build-support/check-extern-template-pairing.py). Instantiations expanded
836
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
837
// skipped -- so their extern pairing has to be kept in sync by hand.
838
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
839
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
840
DECLARE_OPERATOR(ResultSinkLocalState)
841
DECLARE_OPERATOR(JdbcTableSinkLocalState)
842
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
843
DECLARE_OPERATOR(ResultFileSinkLocalState)
844
DECLARE_OPERATOR(OlapTableSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
846
DECLARE_OPERATOR(HiveTableSinkLocalState)
847
DECLARE_OPERATOR(TVFTableSinkLocalState)
848
DECLARE_OPERATOR(IcebergTableSinkLocalState)
849
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
850
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
851
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
852
DECLARE_OPERATOR(MCTableSinkLocalState)
853
DECLARE_OPERATOR(AnalyticSinkLocalState)
854
DECLARE_OPERATOR(BlackholeSinkLocalState)
855
DECLARE_OPERATOR(SortSinkLocalState)
856
DECLARE_OPERATOR(SpillSortSinkLocalState)
857
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
858
DECLARE_OPERATOR(AggSinkLocalState)
859
DECLARE_OPERATOR(BucketedAggSinkLocalState)
860
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
861
DECLARE_OPERATOR(ExchangeSinkLocalState)
862
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
863
DECLARE_OPERATOR(UnionSinkLocalState)
864
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
865
DECLARE_OPERATOR(PartitionSortSinkLocalState)
866
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
867
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
868
DECLARE_OPERATOR(SetSinkLocalState<true>)
869
DECLARE_OPERATOR(SetSinkLocalState<false>)
870
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
871
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
872
DECLARE_OPERATOR(CacheSinkLocalState)
873
DECLARE_OPERATOR(DictSinkLocalState)
874
DECLARE_OPERATOR(RecCTESinkLocalState)
875
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
876
877
#undef DECLARE_OPERATOR
878
879
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
880
DECLARE_OPERATOR(HashJoinProbeLocalState)
881
DECLARE_OPERATOR(OlapScanLocalState)
882
DECLARE_OPERATOR(GroupCommitLocalState)
883
DECLARE_OPERATOR(JDBCScanLocalState)
884
DECLARE_OPERATOR(FileScanLocalState)
885
DECLARE_OPERATOR(AnalyticLocalState)
886
DECLARE_OPERATOR(SortLocalState)
887
DECLARE_OPERATOR(SpillSortLocalState)
888
DECLARE_OPERATOR(LocalMergeSortLocalState)
889
DECLARE_OPERATOR(AggLocalState)
890
DECLARE_OPERATOR(BucketedAggLocalState)
891
DECLARE_OPERATOR(PartitionedAggLocalState)
892
DECLARE_OPERATOR(TableFunctionLocalState)
893
DECLARE_OPERATOR(ExchangeLocalState)
894
DECLARE_OPERATOR(RepeatLocalState)
895
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
896
DECLARE_OPERATOR(AssertNumRowsLocalState)
897
DECLARE_OPERATOR(EmptySetLocalState)
898
DECLARE_OPERATOR(UnionSourceLocalState)
899
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
900
DECLARE_OPERATOR(PartitionSortSourceLocalState)
901
DECLARE_OPERATOR(SetSourceLocalState<true>)
902
DECLARE_OPERATOR(SetSourceLocalState<false>)
903
DECLARE_OPERATOR(DataGenLocalState)
904
DECLARE_OPERATOR(SchemaScanLocalState)
905
DECLARE_OPERATOR(MetaScanLocalState)
906
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
907
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
908
DECLARE_OPERATOR(CacheSourceLocalState)
909
DECLARE_OPERATOR(RecCTESourceLocalState)
910
DECLARE_OPERATOR(RecCTEScanLocalState)
911
912
#ifdef BE_TEST
913
DECLARE_OPERATOR(MockLocalState)
914
DECLARE_OPERATOR(MockScanLocalState)
915
#endif
916
#undef DECLARE_OPERATOR
917
918
template class StreamingOperatorX<AssertNumRowsLocalState>;
919
template class StreamingOperatorX<SelectLocalState>;
920
921
template class StatefulOperatorX<HashJoinProbeLocalState>;
922
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
923
template class StatefulOperatorX<RepeatLocalState>;
924
template class StatefulOperatorX<MaterializationLocalState>;
925
template class StatefulOperatorX<StreamingAggLocalState>;
926
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
927
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
928
template class StatefulOperatorX<TableFunctionLocalState>;
929
930
template class PipelineXSinkLocalState<HashJoinSharedState>;
931
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
932
template class PipelineXSinkLocalState<SortSharedState>;
933
template class PipelineXSinkLocalState<SpillSortSharedState>;
934
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
935
template class PipelineXSinkLocalState<AnalyticSharedState>;
936
template class PipelineXSinkLocalState<AggSharedState>;
937
template class PipelineXSinkLocalState<BucketedAggSharedState>;
938
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
939
template class PipelineXSinkLocalState<FakeSharedState>;
940
template class PipelineXSinkLocalState<UnionSharedState>;
941
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
942
template class PipelineXSinkLocalState<MultiCastSharedState>;
943
template class PipelineXSinkLocalState<SetSharedState>;
944
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
945
template class PipelineXSinkLocalState<BasicSharedState>;
946
template class PipelineXSinkLocalState<DataQueueSharedState>;
947
template class PipelineXSinkLocalState<RecCTESharedState>;
948
949
template class PipelineXLocalState<HashJoinSharedState>;
950
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
951
template class PipelineXLocalState<SortSharedState>;
952
template class PipelineXLocalState<SpillSortSharedState>;
953
template class PipelineXLocalState<NestedLoopJoinSharedState>;
954
template class PipelineXLocalState<AnalyticSharedState>;
955
template class PipelineXLocalState<AggSharedState>;
956
template class PipelineXLocalState<BucketedAggSharedState>;
957
template class PipelineXLocalState<PartitionedAggSharedState>;
958
template class PipelineXLocalState<FakeSharedState>;
959
template class PipelineXLocalState<UnionSharedState>;
960
template class PipelineXLocalState<DataQueueSharedState>;
961
template class PipelineXLocalState<MultiCastSharedState>;
962
template class PipelineXLocalState<PartitionSortNodeSharedState>;
963
template class PipelineXLocalState<SetSharedState>;
964
template class PipelineXLocalState<LocalExchangeSharedState>;
965
template class PipelineXLocalState<BasicSharedState>;
966
template class PipelineXLocalState<RecCTESharedState>;
967
968
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
969
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
970
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
971
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
972
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
973
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
974
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
977
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
978
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
979
980
#ifdef BE_TEST
981
template class OperatorX<DummyOperatorLocalState>;
982
template class DataSinkOperatorX<DummySinkLocalState>;
983
#endif
984
985
} // namespace doris