Coverage Report

Created: 2026-09-20 05:57

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.66M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.66M
    if (_parent->nereids_id() == -1) {
122
859k
        return fmt::format("(id={})", _parent->node_id());
123
859k
    } else {
124
804k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
804k
    }
126
1.66M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
75.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
75.9k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
75.9k
    } else {
124
75.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
75.9k
    }
126
75.9k
}
_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
209k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
209k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
209k
    } else {
124
209k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
209k
    }
126
209k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
27
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
27
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
27
    } else {
124
27
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
27
    }
126
27
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.53k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.53k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
6.53k
    } else {
124
6.53k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.53k
    }
126
6.53k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.16k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.16k
    if (_parent->nereids_id() == -1) {
122
14
        return fmt::format("(id={})", _parent->node_id());
123
8.15k
    } else {
124
8.15k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.15k
    }
126
8.16k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
93.7k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
93.7k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
93.7k
    } else {
124
93.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
93.7k
    }
126
93.7k
}
_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
160
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
160
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
160
    } else {
124
160
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
160
    }
126
160
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
562k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
562k
    if (_parent->nereids_id() == -1) {
122
270k
        return fmt::format("(id={})", _parent->node_id());
123
291k
    } else {
124
291k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
291k
    }
126
562k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.5k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.5k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.5k
    } else {
124
54.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.5k
    }
126
54.5k
}
_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
6.84k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.85k
    if (_parent->nereids_id() == -1) {
122
6.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
6.84k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
736
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
736
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
634
    } else {
124
634
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
634
    }
126
736
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.83k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.83k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
4.82k
    } else {
124
4.82k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4.82k
    }
126
4.83k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
581k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
581k
    if (_parent->nereids_id() == -1) {
122
581k
        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
581k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
169
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
169
    } else {
124
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
169
    }
126
169
}
127
128
template <typename SharedStateArg>
129
1.13M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.13M
    if (_parent->nereids_id() == -1) {
131
627k
        return fmt::format("(id={})", _parent->node_id());
132
627k
    } else {
133
512k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
512k
    }
135
1.13M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
123k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
123k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
123k
    } else {
133
123k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
123k
    }
135
123k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
2
    if (_parent->nereids_id() == -1) {
131
1
        return fmt::format("(id={})", _parent->node_id());
132
1
    } else {
133
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
1
    }
135
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
210k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
210k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
210k
    } else {
133
210k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
210k
    }
135
210k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
34
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
34
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
34
    } else {
133
34
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
34
    }
135
34
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
6.54k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6.54k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
6.54k
    } else {
133
6.54k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
6.54k
    }
135
6.54k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.16k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.16k
    if (_parent->nereids_id() == -1) {
131
14
        return fmt::format("(id={})", _parent->node_id());
132
8.15k
    } else {
133
8.15k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.15k
    }
135
8.16k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
94.2k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
94.2k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
94.2k
    } else {
133
94.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
94.2k
    }
135
94.2k
}
_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
170
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
170
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
170
    } else {
133
170
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
170
    }
135
170
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
18
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
18
    if (_parent->nereids_id() == -1) {
131
18
        return fmt::format("(id={})", _parent->node_id());
132
18
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9.29k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9.29k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
9.29k
    } else {
133
9.29k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
9.29k
    }
135
9.29k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
735
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
735
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
633
    } else {
133
633
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
633
    }
135
735
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.1k
    if (_parent->nereids_id() == -1) {
131
12.1k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
225k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
225k
    if (_parent->nereids_id() == -1) {
131
225k
        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
225k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
388k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
389k
    if (_parent->nereids_id() == -1) {
131
389k
        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
388k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        return fmt::format("(id={})", _parent->node_id());
132
25
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
338
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
338
    } else {
133
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
338
    }
135
338
}
136
137
template <typename SharedStateArg>
138
29.8k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.8k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
29.8k
    _terminated = true;
143
29.8k
    return Status::OK();
144
29.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.06k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.06k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.06k
    _terminated = true;
143
2.06k
    return Status::OK();
144
2.06k
}
_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
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.35k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.35k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.35k
    _terminated = true;
143
1.35k
    return Status::OK();
144
1.35k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
819
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
819
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
819
    _terminated = true;
143
819
    return Status::OK();
144
819
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
584
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
584
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
584
    _terminated = true;
143
584
    return Status::OK();
144
584
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
250
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
250
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
250
    _terminated = true;
143
250
    return Status::OK();
144
250
}
_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
232
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
232
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
232
    _terminated = true;
143
232
    return Status::OK();
144
232
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
7
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
7
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
7
    _terminated = true;
143
7
    return Status::OK();
144
7
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
329
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
329
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
329
    _terminated = true;
143
329
    return Status::OK();
144
329
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1
    _terminated = true;
143
1
    return Status::OK();
144
1
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
142
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
142
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
142
    _terminated = true;
143
142
    return Status::OK();
144
142
}
145
146
301k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
301k
    return _child && _child->is_serial_operator() && !is_source()
148
301k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
301k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
301k
}
151
152
20.0k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
20.0k
    if (!_child) {
154
18.7k
        return false;
155
18.7k
    }
156
1.24k
    if (_child->is_serial_operator()) {
157
187
        return true;
158
187
    }
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.24k
}
163
164
template <typename SharedStateArg>
165
16.1k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.1k
    fmt::memory_buffer debug_string_buffer;
167
16.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.1k
    return fmt::to_string(debug_string_buffer);
169
16.1k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
16.1k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.1k
    fmt::memory_buffer debug_string_buffer;
167
16.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.1k
    return fmt::to_string(debug_string_buffer);
169
16.1k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
16.1k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.1k
    fmt::memory_buffer debug_string_buffer;
174
16.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.1k
    return fmt::to_string(debug_string_buffer);
176
16.1k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
16.1k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.1k
    fmt::memory_buffer debug_string_buffer;
174
16.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.1k
    return fmt::to_string(debug_string_buffer);
176
16.1k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
16.1k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
16.1k
    fmt::memory_buffer debug_string_buffer;
180
16.1k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
16.1k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
16.1k
                   _is_serial_operator);
183
16.1k
    return fmt::to_string(debug_string_buffer);
184
16.1k
}
185
186
16.1k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
16.1k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
16.1k
}
189
190
652k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
652k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
652k
    _nereids_id = tnode.nereids_id;
193
652k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.88k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.88k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.88k
            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.88k
    }
206
652k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
652k
    _op_name = substr + "_OPERATOR";
208
209
652k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
652k
    } else if (tnode.__isset.conjuncts) {
212
273k
        for (const auto& conjunct : tnode.conjuncts) {
213
273k
            VExprContextSPtr context;
214
273k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
273k
            _conjuncts.emplace_back(context);
216
273k
        }
217
99.1k
    }
218
219
    // create the projections expr
220
652k
    if (tnode.__isset.projections) {
221
260k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
260k
    }
223
652k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.88k
        DCHECK(has_projection()) << "no final projections";
225
3.88k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.59k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.59k
            VExprContextSPtrs projections;
228
6.59k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.59k
            _projection->intermediate_projections.push_back(projections);
230
6.59k
        }
231
3.88k
    }
232
652k
    return Status::OK();
233
652k
}
234
235
679k
Status OperatorXBase::prepare(RuntimeState* state) {
236
679k
    for (auto& conjunct : _conjuncts) {
237
273k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
273k
    }
239
679k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
629k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
340k
            return a->execute_cost() < b->execute_cost();
242
340k
        });
243
629k
    };
244
245
679k
    if (has_projection()) {
246
260k
        auto& projection = *_projection;
247
267k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.59k
            const auto& input_row_desc =
249
6.59k
                    i == 0 ? operator_row_desc_before_projection()
250
6.59k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.59k
            RETURN_IF_ERROR(
252
6.59k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.59k
        }
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
679k
    for (auto& conjunct : _conjuncts) {
265
273k
        RETURN_IF_ERROR(conjunct->open(state));
266
273k
    }
267
679k
    if (has_projection()) {
268
260k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
260k
        for (auto& projections : _projection->intermediate_projections) {
270
6.59k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.59k
        }
272
260k
    }
273
679k
    if (_child && !is_source()) {
274
95.8k
        RETURN_IF_ERROR(_child->prepare(state));
275
95.8k
    }
276
277
679k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
679k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
679k
    return Status::OK();
283
679k
}
284
285
6.50k
Status OperatorXBase::terminate(RuntimeState* state) {
286
6.50k
    if (_child && !is_source()) {
287
635
        RETURN_IF_ERROR(_child->terminate(state));
288
635
    }
289
6.50k
    auto result = state->get_local_state_result(operator_id());
290
6.50k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
6.50k
    return result.value()->terminate(state);
294
6.50k
}
295
296
4.52M
Status OperatorXBase::close(RuntimeState* state) {
297
4.52M
    if (_child && !is_source()) {
298
726k
        RETURN_IF_ERROR(_child->close(state));
299
726k
    }
300
4.52M
    auto result = state->get_local_state_result(operator_id());
301
4.52M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.52M
    return result.value()->close(state);
305
4.52M
}
306
307
297k
void PipelineXLocalStateBase::clear_origin_block() {
308
297k
    _origin_block.clear_column_data(
309
297k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
297k
}
311
312
612k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
612k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
612k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
612k
    return Status::OK();
317
612k
}
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
297k
                                     Block* output_block) const {
326
297k
    auto* local_state = state->get_local_state(operator_id());
327
297k
    SCOPED_TIMER(local_state->exec_time_counter());
328
297k
    SCOPED_TIMER(local_state->_projection_timer);
329
297k
    const size_t rows = origin_block->rows();
330
297k
    if (rows == 0) {
331
160k
        return Status::OK();
332
160k
    }
333
137k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
137k
    {
336
137k
        Block input_block = *origin_block;
337
338
137k
        ColumnsWithTypeAndName new_columns;
339
137k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.60k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.60k
            new_columns.resize(projections.size());
345
68.3k
            for (int i = 0; i < projections.size(); i++) {
346
64.7k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
64.7k
                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.7k
            }
355
3.60k
            Block tmp_block {new_columns};
356
3.60k
            input_block.swap(tmp_block);
357
3.60k
        }
358
359
137k
        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
137k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
137k
                output_block, _projection->output_row_descriptor);
368
137k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
137k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
137k
        Columns shared_columns(mutable_columns.size());
371
372
776k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
639k
            ColumnPtr column_ptr;
374
639k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
639k
            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
639k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
639k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
639k
            if (column_ptr->is_exclusive()) {
386
229k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
409k
            } else {
388
409k
                shared_columns[i] = std::move(column_ptr);
389
409k
            }
390
639k
        }
391
392
137k
        scoped_mutable_block.restore();
393
776k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
639k
            if (shared_columns[i]) {
395
409k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
409k
            }
397
639k
        }
398
137k
    }
399
400
0
    origin_block->clear_column_data(
401
137k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
137k
    DCHECK_EQ(output_block->rows(), rows);
403
404
137k
    return Status::OK();
405
137k
}
406
407
3.96M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
3.96M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
3.96M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
3.96M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
3.96M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
3.96M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
3.96M
            if (_debug_point_count++ % 2 == 0) {
414
3.96M
                return Status::OK();
415
3.96M
            }
416
3.96M
        }
417
3.96M
    });
418
419
3.96M
    Status status;
420
3.96M
    auto* local_state = state->get_local_state(operator_id());
421
3.96M
    Defer defer([&]() {
422
3.96M
        if (status.ok()) {
423
3.96M
            local_state->update_output_block_counters(*block);
424
3.96M
        }
425
3.96M
    });
426
3.96M
    if (has_projection()) {
427
297k
        local_state->clear_origin_block();
428
297k
        status = get_block(state, &local_state->_origin_block, eos);
429
297k
        if (UNLIKELY(!status.ok())) {
430
23
            return status;
431
23
        }
432
297k
        status = do_projections(state, &local_state->_origin_block, block);
433
297k
        return status;
434
297k
    }
435
3.66M
    status = get_block(state, block, eos);
436
3.66M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.66M
    return status;
438
3.66M
}
439
440
2.59M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.59M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.52k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.52k
        *eos = true;
444
9.52k
    }
445
446
2.59M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.59M
        auto op_name = to_lower(_parent->_op_name);
448
2.59M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.59M
        arg_op_name = to_lower(arg_op_name);
450
451
2.59M
        if (op_name == arg_op_name) {
452
2.59M
            *eos = true;
453
2.59M
        }
454
2.59M
    });
455
456
2.59M
    if (auto rows = block->rows()) {
457
749k
        _num_rows_returned += rows;
458
749k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
749k
    }
460
2.59M
}
461
462
29.8k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
29.8k
    auto result = state->get_sink_local_state_result();
464
29.8k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
29.8k
    return result.value()->terminate(state);
468
29.8k
}
469
470
16.1k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
16.1k
    fmt::memory_buffer debug_string_buffer;
472
473
16.1k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
16.1k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
16.1k
    return fmt::to_string(debug_string_buffer);
476
16.1k
}
477
478
16.1k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
16.1k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
16.1k
}
481
482
340k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
340k
    std::string op_name = "UNKNOWN_SINK";
484
340k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
341k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
341k
        op_name = it->second;
488
341k
    }
489
340k
    _name = op_name + "_OPERATOR";
490
340k
    return Status::OK();
491
340k
}
492
493
289k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
289k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
289k
    _nereids_id = tnode.nereids_id;
496
289k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
289k
    _name = substr + "_SINK_OPERATOR";
498
289k
    return Status::OK();
499
289k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.63M
                                                            LocalSinkStateInfo& info) {
504
1.63M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.63M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.63M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.63M
    return Status::OK();
508
1.63M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
124k
                                                            LocalSinkStateInfo& info) {
504
124k
    auto local_state = LocalStateType::create_unique(this, state);
505
124k
    RETURN_IF_ERROR(local_state->init(state, info));
506
124k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
124k
    return Status::OK();
508
124k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
342k
                                                            LocalSinkStateInfo& info) {
504
342k
    auto local_state = LocalStateType::create_unique(this, state);
505
342k
    RETURN_IF_ERROR(local_state->init(state, info));
506
342k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
342k
    return Status::OK();
508
342k
}
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
350
                                                            LocalSinkStateInfo& info) {
504
350
    auto local_state = LocalStateType::create_unique(this, state);
505
350
    RETURN_IF_ERROR(local_state->init(state, info));
506
350
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
350
    return Status::OK();
508
350
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
47.7k
                                                            LocalSinkStateInfo& info) {
504
47.7k
    auto local_state = LocalStateType::create_unique(this, state);
505
47.7k
    RETURN_IF_ERROR(local_state->init(state, info));
506
47.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
47.7k
    return Status::OK();
508
47.7k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
34
                                                            LocalSinkStateInfo& info) {
504
34
    auto local_state = LocalStateType::create_unique(this, state);
505
34
    RETURN_IF_ERROR(local_state->init(state, info));
506
34
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
34
    return Status::OK();
508
34
}
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.15k
                                                            LocalSinkStateInfo& info) {
504
8.15k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.15k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.15k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.15k
    return Status::OK();
508
8.15k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
15
                                                            LocalSinkStateInfo& info) {
504
15
    auto local_state = LocalStateType::create_unique(this, state);
505
15
    RETURN_IF_ERROR(local_state->init(state, info));
506
15
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
15
    return Status::OK();
508
15
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
211k
                                                            LocalSinkStateInfo& info) {
504
211k
    auto local_state = LocalStateType::create_unique(this, state);
505
211k
    RETURN_IF_ERROR(local_state->init(state, info));
506
211k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
211k
    return Status::OK();
508
211k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
34
                                                            LocalSinkStateInfo& info) {
504
34
    auto local_state = LocalStateType::create_unique(this, state);
505
34
    RETURN_IF_ERROR(local_state->init(state, info));
506
34
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
34
    return Status::OK();
508
34
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
225k
                                                            LocalSinkStateInfo& info) {
504
225k
    auto local_state = LocalStateType::create_unique(this, state);
505
225k
    RETURN_IF_ERROR(local_state->init(state, info));
506
225k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
225k
    return Status::OK();
508
225k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
94.4k
                                                            LocalSinkStateInfo& info) {
504
94.4k
    auto local_state = LocalStateType::create_unique(this, state);
505
94.4k
    RETURN_IF_ERROR(local_state->init(state, info));
506
94.4k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
94.4k
    return Status::OK();
508
94.4k
}
_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
170
                                                            LocalSinkStateInfo& info) {
504
170
    auto local_state = LocalStateType::create_unique(this, state);
505
170
    RETURN_IF_ERROR(local_state->init(state, info));
506
170
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
170
    return Status::OK();
508
170
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
491k
                                                            LocalSinkStateInfo& info) {
504
491k
    auto local_state = LocalStateType::create_unique(this, state);
505
491k
    RETURN_IF_ERROR(local_state->init(state, info));
506
491k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
491k
    return Status::OK();
508
491k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.54k
                                                            LocalSinkStateInfo& info) {
504
6.54k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.54k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.54k
    return Status::OK();
508
6.54k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
9.31k
                                                            LocalSinkStateInfo& info) {
504
9.31k
    auto local_state = LocalStateType::create_unique(this, state);
505
9.31k
    RETURN_IF_ERROR(local_state->init(state, info));
506
9.31k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9.31k
    return Status::OK();
508
9.31k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.64k
                                                            LocalSinkStateInfo& info) {
504
2.64k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.64k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.64k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.64k
    return Status::OK();
508
2.64k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
632
                                                            LocalSinkStateInfo& info) {
504
632
    auto local_state = LocalStateType::create_unique(this, state);
505
632
    RETURN_IF_ERROR(local_state->init(state, info));
506
632
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
632
    return Status::OK();
508
632
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.65k
                                                            LocalSinkStateInfo& info) {
504
4.65k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.65k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.65k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.65k
    return Status::OK();
508
4.65k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.45k
                                                            LocalSinkStateInfo& info) {
504
2.45k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.45k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.45k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.45k
    return Status::OK();
508
2.45k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.52k
                                                            LocalSinkStateInfo& info) {
504
2.52k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.52k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.52k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.52k
    return Status::OK();
508
2.52k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.41k
                                                            LocalSinkStateInfo& info) {
504
2.41k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.41k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.41k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.41k
    return Status::OK();
508
2.41k
}
_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
105
                                                            LocalSinkStateInfo& info) {
504
105
    auto local_state = LocalStateType::create_unique(this, state);
505
105
    RETURN_IF_ERROR(local_state->init(state, info));
506
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
105
    return Status::OK();
508
105
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
509
510
template <typename LocalStateType>
511
1.31M
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.31M
    } else {
519
1.31M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.31M
        ss->id = operator_id();
521
1.31M
        for (auto& dest : dests_id()) {
522
1.30M
            ss->related_op_ids.insert(dest);
523
1.30M
        }
524
1.31M
        return ss;
525
1.31M
    }
526
1.31M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
108k
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
108k
    } else {
519
108k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
108k
        ss->id = operator_id();
521
108k
        for (auto& dest : dests_id()) {
522
108k
            ss->related_op_ids.insert(dest);
523
108k
        }
524
108k
        return ss;
525
108k
    }
526
108k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
342k
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
342k
    } else {
519
342k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
342k
        ss->id = operator_id();
521
342k
        for (auto& dest : dests_id()) {
522
341k
            ss->related_op_ids.insert(dest);
523
341k
        }
524
342k
        return ss;
525
342k
    }
526
342k
}
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
350
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
350
    } else {
519
350
        auto ss = LocalStateType::SharedStateType::create_shared();
520
350
        ss->id = operator_id();
521
350
        for (auto& dest : dests_id()) {
522
350
            ss->related_op_ids.insert(dest);
523
350
        }
524
350
        return ss;
525
350
    }
526
350
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
47.9k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
47.9k
    } else {
519
47.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
47.9k
        ss->id = operator_id();
521
47.9k
        for (auto& dest : dests_id()) {
522
47.5k
            ss->related_op_ids.insert(dest);
523
47.5k
        }
524
47.9k
        return ss;
525
47.9k
    }
526
47.9k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
34
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
34
    } else {
519
34
        auto ss = LocalStateType::SharedStateType::create_shared();
520
34
        ss->id = operator_id();
521
34
        for (auto& dest : dests_id()) {
522
34
            ss->related_op_ids.insert(dest);
523
34
        }
524
34
        return ss;
525
34
    }
526
34
}
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.18k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8.18k
    } else {
519
8.18k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.18k
        ss->id = operator_id();
521
8.18k
        for (auto& dest : dests_id()) {
522
8.18k
            ss->related_op_ids.insert(dest);
523
8.18k
        }
524
8.18k
        return ss;
525
8.18k
    }
526
8.18k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
15
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
15
    } else {
519
15
        auto ss = LocalStateType::SharedStateType::create_shared();
520
15
        ss->id = operator_id();
521
15
        for (auto& dest : dests_id()) {
522
15
            ss->related_op_ids.insert(dest);
523
15
        }
524
15
        return ss;
525
15
    }
526
15
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
211k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
211k
    } else {
519
211k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
211k
        ss->id = operator_id();
521
211k
        for (auto& dest : dests_id()) {
522
211k
            ss->related_op_ids.insert(dest);
523
211k
        }
524
211k
        return ss;
525
211k
    }
526
211k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
36
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
36
    } else {
519
36
        auto ss = LocalStateType::SharedStateType::create_shared();
520
36
        ss->id = operator_id();
521
36
        for (auto& dest : dests_id()) {
522
36
            ss->related_op_ids.insert(dest);
523
36
        }
524
36
        return ss;
525
36
    }
526
36
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
94.7k
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
94.7k
    } else {
519
94.7k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
94.7k
        ss->id = operator_id();
521
94.8k
        for (auto& dest : dests_id()) {
522
94.8k
            ss->related_op_ids.insert(dest);
523
94.8k
        }
524
94.7k
        return ss;
525
94.7k
    }
526
94.7k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
169
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
169
    } else {
519
169
        auto ss = LocalStateType::SharedStateType::create_shared();
520
169
        ss->id = operator_id();
521
169
        for (auto& dest : dests_id()) {
522
169
            ss->related_op_ids.insert(dest);
523
169
        }
524
169
        return ss;
525
169
    }
526
169
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
491k
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
491k
    } else {
519
491k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
491k
        ss->id = operator_id();
521
491k
        for (auto& dest : dests_id()) {
522
483k
            ss->related_op_ids.insert(dest);
523
483k
        }
524
491k
        return ss;
525
491k
    }
526
491k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.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
6.54k
    } else {
519
6.54k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.54k
        ss->id = operator_id();
521
6.55k
        for (auto& dest : dests_id()) {
522
6.55k
            ss->related_op_ids.insert(dest);
523
6.55k
        }
524
6.54k
        return ss;
525
6.54k
    }
526
6.54k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
736
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
736
    } else {
519
736
        auto ss = LocalStateType::SharedStateType::create_shared();
520
736
        ss->id = operator_id();
521
736
        for (auto& dest : dests_id()) {
522
735
            ss->related_op_ids.insert(dest);
523
735
        }
524
736
        return ss;
525
736
    }
526
736
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.54k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.54k
    } else {
519
2.54k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.54k
        ss->id = operator_id();
521
2.54k
        for (auto& dest : dests_id()) {
522
2.54k
            ss->related_op_ids.insert(dest);
523
2.54k
        }
524
2.54k
        return ss;
525
2.54k
    }
526
2.54k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.43k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.43k
    } else {
519
2.43k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.43k
        ss->id = operator_id();
521
2.43k
        for (auto& dest : dests_id()) {
522
2.43k
            ss->related_op_ids.insert(dest);
523
2.43k
        }
524
2.43k
        return ss;
525
2.43k
    }
526
2.43k
}
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
551
            ss->related_op_ids.insert(dest);
523
551
        }
524
567
        return ss;
525
567
    }
526
567
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
105
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
105
    } else {
519
105
        auto ss = LocalStateType::SharedStateType::create_shared();
520
105
        ss->id = operator_id();
521
105
        for (auto& dest : dests_id()) {
522
105
            ss->related_op_ids.insert(dest);
523
105
        }
524
105
        return ss;
525
105
    }
526
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.92M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.92M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.92M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.92M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.92M
    return Status::OK();
534
1.92M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
76.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
76.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
76.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
76.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
76.0k
    return Status::OK();
534
76.0k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
247k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
247k
    auto local_state = LocalStateType::create_unique(state, this);
531
247k
    RETURN_IF_ERROR(local_state->init(state, info));
532
247k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
247k
    return Status::OK();
534
247k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
129
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
129
    auto local_state = LocalStateType::create_unique(state, this);
531
129
    RETURN_IF_ERROR(local_state->init(state, info));
532
129
    state->emplace_local_state(operator_id(), std::move(local_state));
533
129
    return Status::OK();
534
129
}
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.15k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.15k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.15k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.15k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.15k
    return Status::OK();
534
8.15k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.04k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.04k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.04k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.04k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.04k
    return Status::OK();
534
8.04k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_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_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
202k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
202k
    auto local_state = LocalStateType::create_unique(state, this);
531
202k
    RETURN_IF_ERROR(local_state->init(state, info));
532
202k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
202k
    return Status::OK();
534
202k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
94.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
94.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
94.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
94.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
94.3k
    return Status::OK();
534
94.3k
}
_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
160
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
160
    auto local_state = LocalStateType::create_unique(state, this);
531
160
    RETURN_IF_ERROR(local_state->init(state, info));
532
160
    state->emplace_local_state(operator_id(), std::move(local_state));
533
160
    return Status::OK();
534
160
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.03k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.03k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.03k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.03k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.03k
    return Status::OK();
534
5.03k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
271k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
271k
    auto local_state = LocalStateType::create_unique(state, this);
531
271k
    RETURN_IF_ERROR(local_state->init(state, info));
532
271k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
271k
    return Status::OK();
534
271k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.33k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.33k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.33k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.33k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.33k
    return Status::OK();
534
1.33k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.54k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.54k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.54k
    return Status::OK();
534
6.54k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
27
    auto local_state = LocalStateType::create_unique(state, this);
531
27
    RETURN_IF_ERROR(local_state->init(state, info));
532
27
    state->emplace_local_state(operator_id(), std::move(local_state));
533
27
    return Status::OK();
534
27
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
54.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.7k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.7k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.7k
    return Status::OK();
534
54.7k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.83k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.83k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.83k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.83k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.83k
    return Status::OK();
534
6.83k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
633
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
633
    auto local_state = LocalStateType::create_unique(state, this);
531
633
    RETURN_IF_ERROR(local_state->init(state, info));
532
633
    state->emplace_local_state(operator_id(), std::move(local_state));
533
633
    return Status::OK();
534
633
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.51k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.51k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.51k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.51k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.51k
    return Status::OK();
534
2.51k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.39k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.39k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.39k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.39k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.39k
    return Status::OK();
534
2.39k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
327
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
327
    auto local_state = LocalStateType::create_unique(state, this);
531
327
    RETURN_IF_ERROR(local_state->init(state, info));
532
327
    state->emplace_local_state(operator_id(), std::move(local_state));
533
327
    return Status::OK();
534
327
}
_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
587k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
587k
    auto local_state = LocalStateType::create_unique(state, this);
531
587k
    RETURN_IF_ERROR(local_state->init(state, info));
532
587k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
587k
    return Status::OK();
534
587k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
14
    auto local_state = LocalStateType::create_unique(state, this);
531
14
    RETURN_IF_ERROR(local_state->init(state, info));
532
14
    state->emplace_local_state(operator_id(), std::move(local_state));
533
14
    return Status::OK();
534
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
169
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
169
    auto local_state = LocalStateType::create_unique(state, this);
531
169
    RETURN_IF_ERROR(local_state->init(state, info));
532
169
    state->emplace_local_state(operator_id(), std::move(local_state));
533
169
    return Status::OK();
534
169
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.20k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.20k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.20k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.20k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.20k
    return Status::OK();
534
2.20k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
786
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
786
    auto local_state = LocalStateType::create_unique(state, this);
531
786
    RETURN_IF_ERROR(local_state->init(state, info));
532
786
    state->emplace_local_state(operator_id(), std::move(local_state));
533
786
    return Status::OK();
534
786
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.22k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.22k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.22k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.22k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.22k
    return Status::OK();
534
1.22k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.49k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.49k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.49k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.49k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.49k
    return Status::OK();
534
7.49k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
260k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
260k
    auto local_state = LocalStateType::create_unique(state, this);
531
260k
    RETURN_IF_ERROR(local_state->init(state, info));
532
260k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
260k
    return Status::OK();
534
260k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.62M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.91M
        : _num_rows_returned(0),
542
1.91M
          _rows_returned_counter(nullptr),
543
1.91M
          _parent(parent),
544
1.91M
          _state(state),
545
1.91M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.92M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.92M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.92M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.92M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.92M
    _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.92M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.92M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.92M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.92M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.92M
    if constexpr (!is_fake_shared) {
560
1.11M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
655k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
655k
                                    .first.get()
563
655k
                                    ->template cast<SharedStateArg>();
564
565
655k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
655k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
655k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
655k
        } else if (info.shared_state) {
569
388k
            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
388k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
388k
            _dependency = _shared_state->create_source_dependency(
576
388k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
388k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
388k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
388k
        } else {
580
69.6k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
8.40k
                DCHECK(false);
582
8.40k
            }
583
69.6k
        }
584
1.11M
    }
585
586
1.92M
    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.92M
    _rows_returned_counter =
591
1.92M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.92M
    _blocks_returned_counter =
593
1.92M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.92M
    _output_block_bytes_counter =
595
1.92M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.92M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.92M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.92M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.92M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.92M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.92M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.92M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.92M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.92M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.92M
    _memory_used_counter =
606
1.92M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.92M
    _common_profile->add_info_string("IsColocate",
608
1.92M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.92M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.92M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.92M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.92M
    return Status::OK();
613
1.92M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
76.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
76.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
76.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
76.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
76.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
76.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
76.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
76.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
76.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
76.2k
    if constexpr (!is_fake_shared) {
560
76.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
15.3k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
15.3k
                                    .first.get()
563
15.3k
                                    ->template cast<SharedStateArg>();
564
565
15.3k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
15.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
15.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
60.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
60.1k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
60.1k
            _dependency = _shared_state->create_source_dependency(
576
60.1k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
60.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
60.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
60.1k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
668
        }
584
76.2k
    }
585
586
76.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
76.2k
    _rows_returned_counter =
591
76.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
76.2k
    _blocks_returned_counter =
593
76.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
76.2k
    _output_block_bytes_counter =
595
76.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
76.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
76.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
76.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
76.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
76.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
76.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
76.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
76.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
76.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
76.2k
    _memory_used_counter =
606
76.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
76.2k
    _common_profile->add_info_string("IsColocate",
608
76.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
76.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
76.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
76.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
76.2k
    return Status::OK();
613
76.2k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1
    _operator_profile->add_child(_common_profile.get(), true);
557
1
    _operator_profile->add_child(_custom_profile.get(), true);
558
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1
    if constexpr (!is_fake_shared) {
560
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
1
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1
            _dependency = _shared_state->create_source_dependency(
576
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
1
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
1
    }
585
586
1
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1
    _rows_returned_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1
    _blocks_returned_counter =
593
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1
    _output_block_bytes_counter =
595
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1
    _memory_used_counter =
606
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1
    _common_profile->add_info_string("IsColocate",
608
1
                                     std::to_string(_parent->is_colocated_operator()));
609
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1
    return Status::OK();
613
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
211k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
211k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
211k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
211k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
211k
    _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
211k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
211k
    _operator_profile->add_child(_common_profile.get(), true);
557
211k
    _operator_profile->add_child(_custom_profile.get(), true);
558
211k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
211k
    if constexpr (!is_fake_shared) {
560
211k
        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
211k
        } 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
204k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
204k
            _dependency = _shared_state->create_source_dependency(
576
204k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
204k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
204k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
204k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
7.32k
        }
584
211k
    }
585
586
211k
    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
211k
    _rows_returned_counter =
591
211k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
211k
    _blocks_returned_counter =
593
211k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
211k
    _output_block_bytes_counter =
595
211k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
211k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
211k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
211k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
211k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
211k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
211k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
211k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
211k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
211k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
211k
    _memory_used_counter =
606
211k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
211k
    _common_profile->add_info_string("IsColocate",
608
211k
                                     std::to_string(_parent->is_colocated_operator()));
609
211k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
211k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
211k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
211k
    return Status::OK();
613
211k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
27
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
27
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
27
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
27
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
27
    _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
27
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
27
    _operator_profile->add_child(_common_profile.get(), true);
557
27
    _operator_profile->add_child(_custom_profile.get(), true);
558
27
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
27
    if constexpr (!is_fake_shared) {
560
27
        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
27
        } 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
27
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
27
            _dependency = _shared_state->create_source_dependency(
576
27
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
27
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
27
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
27
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
27
    }
585
586
27
    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
27
    _rows_returned_counter =
591
27
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
27
    _blocks_returned_counter =
593
27
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
27
    _output_block_bytes_counter =
595
27
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
27
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
27
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
27
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
27
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
27
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
27
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
27
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
27
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
27
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
27
    _memory_used_counter =
606
27
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
27
    _common_profile->add_info_string("IsColocate",
608
27
                                     std::to_string(_parent->is_colocated_operator()));
609
27
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
27
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
27
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
27
    return Status::OK();
613
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.54k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.54k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.54k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.54k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.54k
    _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.54k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.54k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.54k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.54k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.54k
    if constexpr (!is_fake_shared) {
560
6.54k
        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.54k
        } 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.51k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.51k
            _dependency = _shared_state->create_source_dependency(
576
6.51k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.51k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.51k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.51k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
38
        }
584
6.54k
    }
585
586
6.54k
    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.54k
    _rows_returned_counter =
591
6.54k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.54k
    _blocks_returned_counter =
593
6.54k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.54k
    _output_block_bytes_counter =
595
6.54k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.54k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.54k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.54k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.54k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.54k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.54k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.54k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.54k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.54k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.54k
    _memory_used_counter =
606
6.54k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.54k
    _common_profile->add_info_string("IsColocate",
608
6.54k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.54k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.54k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.54k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.54k
    return Status::OK();
613
6.54k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.18k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.18k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.18k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.18k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.18k
    _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.18k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.18k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.18k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.18k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.18k
    if constexpr (!is_fake_shared) {
560
8.18k
        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.18k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
8.13k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.13k
            _dependency = _shared_state->create_source_dependency(
576
8.13k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.13k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.13k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.13k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
51
        }
584
8.18k
    }
585
586
8.18k
    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.18k
    _rows_returned_counter =
591
8.18k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.18k
    _blocks_returned_counter =
593
8.18k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.18k
    _output_block_bytes_counter =
595
8.18k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.18k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.18k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.18k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.18k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.18k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.18k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.18k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.18k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.18k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.18k
    _memory_used_counter =
606
8.18k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.18k
    _common_profile->add_info_string("IsColocate",
608
8.18k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.18k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.18k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.18k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.18k
    return Status::OK();
613
8.18k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
94.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
94.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
94.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
94.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
94.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
94.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
94.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
94.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
94.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
94.8k
    if constexpr (!is_fake_shared) {
560
94.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
94.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
92.5k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
92.5k
            _dependency = _shared_state->create_source_dependency(
576
92.5k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
92.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
92.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
92.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
2.34k
        }
584
94.8k
    }
585
586
94.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
94.8k
    _rows_returned_counter =
591
94.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
94.8k
    _blocks_returned_counter =
593
94.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
94.8k
    _output_block_bytes_counter =
595
94.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
94.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
94.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
94.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
94.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
94.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
94.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
94.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
94.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
94.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
94.8k
    _memory_used_counter =
606
94.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
94.8k
    _common_profile->add_info_string("IsColocate",
608
94.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
94.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
94.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
94.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
94.8k
    return Status::OK();
613
94.8k
}
_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.2k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
59.2k
                                    .first.get()
563
59.2k
                                    ->template cast<SharedStateArg>();
564
565
59.2k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
59.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
59.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
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
160
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
160
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
160
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
160
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
160
    _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
160
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
160
    _operator_profile->add_child(_common_profile.get(), true);
557
160
    _operator_profile->add_child(_custom_profile.get(), true);
558
160
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
160
    if constexpr (!is_fake_shared) {
560
160
        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
160
        } 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
160
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
160
            _dependency = _shared_state->create_source_dependency(
576
160
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
160
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
160
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
160
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
160
    }
585
586
160
    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
160
    _rows_returned_counter =
591
160
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
160
    _blocks_returned_counter =
593
160
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
160
    _output_block_bytes_counter =
595
160
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
160
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
160
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
160
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
160
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
160
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
160
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
160
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
160
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
160
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
160
    _memory_used_counter =
606
160
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
160
    _common_profile->add_info_string("IsColocate",
608
160
                                     std::to_string(_parent->is_colocated_operator()));
609
160
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
160
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
160
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
160
    return Status::OK();
613
160
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
812k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
812k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
812k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
812k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
812k
    _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
812k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
812k
    _operator_profile->add_child(_common_profile.get(), true);
557
812k
    _operator_profile->add_child(_custom_profile.get(), true);
558
812k
    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
812k
    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
812k
    _rows_returned_counter =
591
812k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
812k
    _blocks_returned_counter =
593
812k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
812k
    _output_block_bytes_counter =
595
812k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
812k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
812k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
812k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
812k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
812k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
812k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
812k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
812k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
812k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
812k
    _memory_used_counter =
606
812k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
812k
    _common_profile->add_info_string("IsColocate",
608
812k
                                     std::to_string(_parent->is_colocated_operator()));
609
812k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
812k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
812k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
812k
    return Status::OK();
613
812k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.5k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
54.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.5k
    if constexpr (!is_fake_shared) {
560
54.5k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.5k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.11k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.11k
            _dependency = _shared_state->create_source_dependency(
576
4.11k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.11k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.11k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.4k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
50.4k
        }
584
54.5k
    }
585
586
54.5k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
54.5k
    _rows_returned_counter =
591
54.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.5k
    _blocks_returned_counter =
593
54.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.5k
    _output_block_bytes_counter =
595
54.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.5k
    _memory_used_counter =
606
54.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.5k
    _common_profile->add_info_string("IsColocate",
608
54.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.5k
    return Status::OK();
613
54.5k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.85k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.85k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.85k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.85k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.85k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.85k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.85k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.85k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.85k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.85k
    if constexpr (!is_fake_shared) {
560
6.85k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.85k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.82k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.82k
            _dependency = _shared_state->create_source_dependency(
576
6.82k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.82k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.82k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.82k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
30
        }
584
6.85k
    }
585
586
6.85k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.85k
    _rows_returned_counter =
591
6.85k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.85k
    _blocks_returned_counter =
593
6.85k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.85k
    _output_block_bytes_counter =
595
6.85k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.85k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.85k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.85k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.85k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.85k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.85k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.85k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.85k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.85k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.85k
    _memory_used_counter =
606
6.85k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.85k
    _common_profile->add_info_string("IsColocate",
608
6.85k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.85k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.85k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.85k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.85k
    return Status::OK();
613
6.85k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
736
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
736
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
736
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
736
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
736
    _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
736
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
736
    _operator_profile->add_child(_common_profile.get(), true);
557
736
    _operator_profile->add_child(_custom_profile.get(), true);
558
736
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
736
    if constexpr (!is_fake_shared) {
560
736
        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
736
        } 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
736
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
736
            _dependency = _shared_state->create_source_dependency(
576
736
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
736
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
736
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
736
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
736
    }
585
586
736
    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
736
    _rows_returned_counter =
591
736
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
736
    _blocks_returned_counter =
593
736
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
736
    _output_block_bytes_counter =
595
736
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
736
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
736
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
736
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
736
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
736
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
736
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
736
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
736
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
736
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
736
    _memory_used_counter =
606
736
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
736
    _common_profile->add_info_string("IsColocate",
608
736
                                     std::to_string(_parent->is_colocated_operator()));
609
736
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
736
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
736
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
736
    return Status::OK();
613
736
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.00k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.00k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.00k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.00k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.00k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.00k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.00k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.00k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.00k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.00k
    if constexpr (!is_fake_shared) {
560
5.00k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.00k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.64k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.64k
            _dependency = _shared_state->create_source_dependency(
576
4.64k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.64k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.64k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.64k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
361
        }
584
5.00k
    }
585
586
5.00k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.00k
    _rows_returned_counter =
591
5.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.00k
    _blocks_returned_counter =
593
5.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.00k
    _output_block_bytes_counter =
595
5.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.00k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.00k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.00k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.00k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.00k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.00k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.00k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.00k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.00k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.00k
    _memory_used_counter =
606
5.00k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.00k
    _common_profile->add_info_string("IsColocate",
608
5.00k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.00k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.00k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.00k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.00k
    return Status::OK();
613
5.00k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
589k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
589k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
589k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
589k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
589k
    _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
589k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
589k
    _operator_profile->add_child(_common_profile.get(), true);
557
589k
    _operator_profile->add_child(_custom_profile.get(), true);
558
589k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
589k
    if constexpr (!is_fake_shared) {
560
589k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
581k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
581k
                                    .first.get()
563
581k
                                    ->template cast<SharedStateArg>();
564
565
581k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
581k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
581k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
581k
        } 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.40k
        } else {
580
8.40k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
8.40k
                DCHECK(false);
582
8.40k
            }
583
8.40k
        }
584
589k
    }
585
586
589k
    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
589k
    _rows_returned_counter =
591
589k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
589k
    _blocks_returned_counter =
593
589k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
589k
    _output_block_bytes_counter =
595
589k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
589k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
589k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
589k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
589k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
589k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
589k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
589k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
589k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
589k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
589k
    _memory_used_counter =
606
589k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
589k
    _common_profile->add_info_string("IsColocate",
608
589k
                                     std::to_string(_parent->is_colocated_operator()));
609
589k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
589k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
589k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
589k
    return Status::OK();
613
589k
}
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.93M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.93M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.24M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
308k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
308k
    }
621
1.93M
    if (_parent->has_projection()) {
622
391k
        const auto& projection = *_parent->_projection;
623
391k
        _projections.resize(projection.projections.size());
624
2.40M
        for (size_t i = 0; i < _projections.size(); i++) {
625
2.01M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
2.01M
        }
627
391k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
405k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
13.8k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
225k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
211k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
211k
                        state, _intermediate_projections[i][j]));
633
211k
            }
634
13.8k
        }
635
391k
    }
636
1.93M
    return Status::OK();
637
1.93M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
76.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
76.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
78.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.76k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.76k
    }
621
76.3k
    if (_parent->has_projection()) {
622
76.3k
        const auto& projection = *_parent->_projection;
623
76.3k
        _projections.resize(projection.projections.size());
624
402k
        for (size_t i = 0; i < _projections.size(); i++) {
625
326k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
326k
        }
627
76.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
84.1k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.81k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
184k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
177k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
177k
                        state, _intermediate_projections[i][j]));
633
177k
            }
634
7.81k
        }
635
76.3k
    }
636
76.3k
    return Status::OK();
637
76.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
212k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
212k
    _conjuncts.resize(_parent->_conjuncts.size());
618
212k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
212k
    if (_parent->has_projection()) {
622
80
        const auto& projection = *_parent->_projection;
623
80
        _projections.resize(projection.projections.size());
624
405
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
80
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
80
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
80
    }
636
212k
    return Status::OK();
637
212k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
27
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
27
    _conjuncts.resize(_parent->_conjuncts.size());
618
27
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
27
    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
27
    return Status::OK();
637
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.55k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.55k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.66k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
104
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
104
    }
621
6.56k
    if (_parent->has_projection()) {
622
6.56k
        const auto& projection = *_parent->_projection;
623
6.56k
        _projections.resize(projection.projections.size());
624
29.4k
        for (size_t i = 0; i < _projections.size(); i++) {
625
22.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
22.8k
        }
627
6.56k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.60k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
47
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
348
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
301
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
301
                        state, _intermediate_projections[i][j]));
633
301
            }
634
47
        }
635
6.56k
    }
636
6.55k
    return Status::OK();
637
6.55k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.18k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.18k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.19k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.00k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.00k
    }
621
8.18k
    if (_parent->has_projection()) {
622
4.89k
        const auto& projection = *_parent->_projection;
623
4.89k
        _projections.resize(projection.projections.size());
624
19.3k
        for (size_t i = 0; i < _projections.size(); i++) {
625
14.4k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
14.4k
        }
627
4.89k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.98k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
90
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
684
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
594
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
594
                        state, _intermediate_projections[i][j]));
633
594
            }
634
90
        }
635
4.89k
    }
636
8.18k
    return Status::OK();
637
8.18k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
95.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
95.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
97.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
2.37k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
2.37k
    }
621
95.0k
    if (_parent->has_projection()) {
622
31.0k
        const auto& projection = *_parent->_projection;
623
31.0k
        _projections.resize(projection.projections.size());
624
276k
        for (size_t i = 0; i < _projections.size(); i++) {
625
245k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
245k
        }
627
31.0k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
31.1k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
168
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
965
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
797
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
797
                        state, _intermediate_projections[i][j]));
633
797
            }
634
168
        }
635
31.0k
    }
636
95.0k
    return Status::OK();
637
95.0k
}
_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
16
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
16
    }
621
59.3k
    if (_parent->has_projection()) {
622
111
        const auto& projection = *_parent->_projection;
623
111
        _projections.resize(projection.projections.size());
624
408
        for (size_t i = 0; i < _projections.size(); i++) {
625
297
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
297
        }
627
111
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
112
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
1
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
2
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
2
                        state, _intermediate_projections[i][j]));
633
2
            }
634
1
        }
635
111
    }
636
59.3k
    return Status::OK();
637
59.3k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
164
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
164
    _conjuncts.resize(_parent->_conjuncts.size());
618
164
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
164
    if (_parent->has_projection()) {
622
138
        const auto& projection = *_parent->_projection;
623
138
        _projections.resize(projection.projections.size());
624
414
        for (size_t i = 0; i < _projections.size(); i++) {
625
276
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
276
        }
627
138
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
138
        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
138
    }
636
164
    return Status::OK();
637
164
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
817k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
817k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.12M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
302k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
302k
    }
621
817k
    if (_parent->has_projection()) {
622
260k
        const auto& projection = *_parent->_projection;
623
260k
        _projections.resize(projection.projections.size());
624
1.56M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.30M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.30M
        }
627
260k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
266k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
5.58k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
35.1k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
29.5k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
29.5k
                        state, _intermediate_projections[i][j]));
633
29.5k
            }
634
5.58k
        }
635
260k
    }
636
817k
    return Status::OK();
637
817k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.9k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
54.9k
    if (_parent->has_projection()) {
622
11.3k
        const auto& projection = *_parent->_projection;
623
11.3k
        _projections.resize(projection.projections.size());
624
110k
        for (size_t i = 0; i < _projections.size(); i++) {
625
99.2k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
99.2k
        }
627
11.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
174
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3.68k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3.50k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3.50k
                        state, _intermediate_projections[i][j]));
633
3.50k
            }
634
174
        }
635
11.3k
    }
636
54.9k
    return Status::OK();
637
54.9k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.85k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.85k
    _conjuncts.resize(_parent->_conjuncts.size());
618
8.06k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.21k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.21k
    }
621
6.85k
    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
6.85k
    return Status::OK();
637
6.85k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
736
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
736
    _conjuncts.resize(_parent->_conjuncts.size());
618
736
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
736
    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
736
    return Status::OK();
637
736
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.06k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.06k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.06k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
5.06k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
228
        for (size_t i = 0; i < _projections.size(); i++) {
625
168
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
168
        }
627
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
60
    }
636
5.06k
    return Status::OK();
637
5.06k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
593k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
593k
    _conjuncts.resize(_parent->_conjuncts.size());
618
593k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
593k
    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
593k
    return Status::OK();
637
593k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
169
    _conjuncts.resize(_parent->_conjuncts.size());
618
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
169
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
491
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
166
    }
636
169
    return Status::OK();
637
169
}
638
639
template <typename SharedStateArg>
640
6.50k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.50k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.50k
    _terminated = true;
645
6.50k
    return Status::OK();
646
6.50k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
293
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
293
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
293
    _terminated = true;
645
293
    return Status::OK();
646
293
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
18
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
18
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
18
    _terminated = true;
645
18
    return Status::OK();
646
18
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
42
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
42
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
42
    _terminated = true;
645
42
    return Status::OK();
646
42
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_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
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
80
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
80
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
80
    _terminated = true;
645
80
    return Status::OK();
646
80
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4.68k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4.68k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
4.68k
    _terminated = true;
645
4.68k
    return Status::OK();
646
4.68k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
47
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
47
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
47
    _terminated = true;
645
47
    return Status::OK();
646
47
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
230
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
230
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
230
    _terminated = true;
645
230
    return Status::OK();
646
230
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.08k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.08k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1.08k
    _terminated = true;
645
1.08k
    return Status::OK();
646
1.08k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
29
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
29
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
29
    _terminated = true;
645
29
    return Status::OK();
646
29
}
647
648
template <typename SharedStateArg>
649
2.17M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.17M
    if (_closed) {
651
242k
        return Status::OK();
652
242k
    }
653
1.93M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.11M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.11M
    }
656
1.93M
    _closed = true;
657
1.93M
    return Status::OK();
658
2.17M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
76.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
76.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
76.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
76.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
76.2k
    }
656
76.2k
    _closed = true;
657
76.2k
    return Status::OK();
658
76.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
421k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
421k
    if (_closed) {
651
211k
        return Status::OK();
652
211k
    }
653
209k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
209k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
209k
    }
656
209k
    _closed = true;
657
209k
    return Status::OK();
658
421k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
27
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
27
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
27
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
27
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
27
    }
656
27
    _closed = true;
657
27
    return Status::OK();
658
27
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.54k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.54k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.54k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.54k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.54k
    }
656
6.54k
    _closed = true;
657
6.54k
    return Status::OK();
658
6.54k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
16.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
16.5k
    if (_closed) {
651
8.37k
        return Status::OK();
652
8.37k
    }
653
8.16k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.16k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.16k
    }
656
8.16k
    _closed = true;
657
8.16k
    return Status::OK();
658
16.5k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
94.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
94.8k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
94.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
94.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
94.8k
    }
656
94.8k
    _closed = true;
657
94.8k
    return Status::OK();
658
94.8k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
59.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
59.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
59.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
59.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
59.0k
    }
656
59.0k
    _closed = true;
657
59.0k
    return Status::OK();
658
59.0k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
159
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
159
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
159
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
159
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
159
    }
656
159
    _closed = true;
657
159
    return Status::OK();
658
159
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
834k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
834k
    if (_closed) {
651
16.1k
        return Status::OK();
652
16.1k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
818k
    _closed = true;
657
818k
    return Status::OK();
658
834k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.9k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.9k
    }
656
54.9k
    _closed = true;
657
54.9k
    return Status::OK();
658
54.9k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
27
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
27
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
13
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
13
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
13
    }
656
13
    _closed = true;
657
13
    return Status::OK();
658
27
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.81k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.81k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.81k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.81k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.81k
    }
656
6.81k
    _closed = true;
657
6.81k
    return Status::OK();
658
6.81k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
1.26k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
1.26k
    if (_closed) {
651
632
        return Status::OK();
652
632
    }
653
628
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
628
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
628
    }
656
628
    _closed = true;
657
628
    return Status::OK();
658
1.26k
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.3k
    if (_closed) {
651
5.30k
        return Status::OK();
652
5.30k
    }
653
5.05k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.05k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.05k
    }
656
5.05k
    _closed = true;
657
5.05k
    return Status::OK();
658
10.3k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
594k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
594k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
594k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
594k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
594k
    }
656
594k
    _closed = true;
657
594k
    return Status::OK();
658
594k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
338
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
338
    if (_closed) {
651
178
        return Status::OK();
652
178
    }
653
160
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
160
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
160
    }
656
160
    _closed = true;
657
160
    return Status::OK();
658
338
}
659
660
template <typename SharedState>
661
1.63M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.63M
    _operator_profile =
664
1.63M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.63M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.63M
    _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.63M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.63M
    _operator_profile->add_child(_common_profile, true);
673
1.63M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.63M
    _operator_profile->set_metadata(_parent->node_id());
676
1.63M
    _wait_for_finish_dependency_timer =
677
1.63M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.63M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.63M
    if constexpr (!is_fake_shared) {
680
1.14M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.14M
            info.shared_state_map.end()) {
682
300k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
225k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
225k
            }
685
300k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
300k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
300k
                                                  ? 0
688
300k
                                                  : info.task_idx]
689
300k
                                  .get();
690
300k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
845k
        } else {
692
845k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
175
                DCHECK(false);
694
175
            }
695
845k
            _shared_state = info.shared_state->template cast<SharedState>();
696
845k
            _dependency = _shared_state->create_sink_dependency(
697
845k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
845k
        }
699
1.14M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.14M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.14M
    }
702
703
1.63M
    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.63M
    _rows_input_counter =
708
1.63M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.63M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.63M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.63M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.63M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.63M
    _memory_used_counter =
714
1.63M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.63M
    _common_profile->add_info_string("IsColocate",
716
1.63M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.63M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.63M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.63M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.63M
    return Status::OK();
721
1.63M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
124k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
124k
    _operator_profile =
664
124k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
124k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
124k
    _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
124k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
124k
    _operator_profile->add_child(_common_profile, true);
673
124k
    _operator_profile->add_child(_custom_profile, true);
674
675
124k
    _operator_profile->set_metadata(_parent->node_id());
676
124k
    _wait_for_finish_dependency_timer =
677
124k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
124k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
124k
    if constexpr (!is_fake_shared) {
680
124k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
124k
            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
108k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
108k
            _shared_state = info.shared_state->template cast<SharedState>();
696
108k
            _dependency = _shared_state->create_sink_dependency(
697
108k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
108k
        }
699
124k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
124k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
124k
    }
702
703
124k
    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
124k
    _rows_input_counter =
708
124k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
124k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
124k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
124k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
124k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
124k
    _memory_used_counter =
714
124k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
124k
    _common_profile->add_info_string("IsColocate",
716
124k
                                     std::to_string(_parent->is_colocated_operator()));
717
124k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
124k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
124k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
124k
    return Status::OK();
721
124k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2
    _operator_profile =
664
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2
    _operator_profile->add_child(_common_profile, true);
673
2
    _operator_profile->add_child(_custom_profile, true);
674
675
2
    _operator_profile->set_metadata(_parent->node_id());
676
2
    _wait_for_finish_dependency_timer =
677
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2
    if constexpr (!is_fake_shared) {
680
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2
            _shared_state = info.shared_state->template cast<SharedState>();
696
2
            _dependency = _shared_state->create_sink_dependency(
697
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2
        }
699
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2
    }
702
703
2
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2
    _rows_input_counter =
708
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2
    _memory_used_counter =
714
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2
    _common_profile->add_info_string("IsColocate",
716
2
                                     std::to_string(_parent->is_colocated_operator()));
717
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2
    return Status::OK();
721
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
211k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
211k
    _operator_profile =
664
211k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
211k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
211k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
211k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
211k
    _operator_profile->add_child(_common_profile, true);
673
211k
    _operator_profile->add_child(_custom_profile, true);
674
675
211k
    _operator_profile->set_metadata(_parent->node_id());
676
211k
    _wait_for_finish_dependency_timer =
677
211k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
211k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
211k
    if constexpr (!is_fake_shared) {
680
211k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
211k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
211k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
211k
            _shared_state = info.shared_state->template cast<SharedState>();
696
211k
            _dependency = _shared_state->create_sink_dependency(
697
211k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
211k
        }
699
211k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
211k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
211k
    }
702
703
211k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
211k
    _rows_input_counter =
708
211k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
211k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
211k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
211k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
211k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
211k
    _memory_used_counter =
714
211k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
211k
    _common_profile->add_info_string("IsColocate",
716
211k
                                     std::to_string(_parent->is_colocated_operator()));
717
211k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
211k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
211k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
211k
    return Status::OK();
721
211k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
34
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
34
    _operator_profile =
664
34
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
34
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
34
    _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
34
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
34
    _operator_profile->add_child(_common_profile, true);
673
34
    _operator_profile->add_child(_custom_profile, true);
674
675
34
    _operator_profile->set_metadata(_parent->node_id());
676
34
    _wait_for_finish_dependency_timer =
677
34
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
34
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
34
    if constexpr (!is_fake_shared) {
680
34
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
34
            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
34
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
34
            _shared_state = info.shared_state->template cast<SharedState>();
696
34
            _dependency = _shared_state->create_sink_dependency(
697
34
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
34
        }
699
34
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
34
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
34
    }
702
703
34
    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
34
    _rows_input_counter =
708
34
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
34
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
34
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
34
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
34
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
34
    _memory_used_counter =
714
34
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
34
    _common_profile->add_info_string("IsColocate",
716
34
                                     std::to_string(_parent->is_colocated_operator()));
717
34
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
34
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
34
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
34
    return Status::OK();
721
34
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.54k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.54k
    _operator_profile =
664
6.54k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.54k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.54k
    _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.54k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.54k
    _operator_profile->add_child(_common_profile, true);
673
6.54k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.54k
    _operator_profile->set_metadata(_parent->node_id());
676
6.54k
    _wait_for_finish_dependency_timer =
677
6.54k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.54k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.54k
    if constexpr (!is_fake_shared) {
680
6.54k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.54k
            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.54k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.54k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.54k
            _dependency = _shared_state->create_sink_dependency(
697
6.54k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.54k
        }
699
6.54k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.54k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.54k
    }
702
703
6.54k
    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.54k
    _rows_input_counter =
708
6.54k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.54k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.54k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.54k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.54k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.54k
    _memory_used_counter =
714
6.54k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.54k
    _common_profile->add_info_string("IsColocate",
716
6.54k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.54k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.54k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.54k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.54k
    return Status::OK();
721
6.54k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.17k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.17k
    _operator_profile =
664
8.17k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.17k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.17k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.17k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.17k
    _operator_profile->add_child(_common_profile, true);
673
8.17k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.17k
    _operator_profile->set_metadata(_parent->node_id());
676
8.17k
    _wait_for_finish_dependency_timer =
677
8.17k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.17k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.17k
    if constexpr (!is_fake_shared) {
680
8.17k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.17k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.17k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.17k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.17k
            _dependency = _shared_state->create_sink_dependency(
697
8.17k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.17k
        }
699
8.17k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.17k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.17k
    }
702
703
8.17k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.17k
    _rows_input_counter =
708
8.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.17k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.17k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.17k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.17k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.17k
    _memory_used_counter =
714
8.17k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.17k
    _common_profile->add_info_string("IsColocate",
716
8.17k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.17k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.17k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.17k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.17k
    return Status::OK();
721
8.17k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
94.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
94.7k
    _operator_profile =
664
94.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
94.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
94.7k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
94.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
94.7k
    _operator_profile->add_child(_common_profile, true);
673
94.7k
    _operator_profile->add_child(_custom_profile, true);
674
675
94.7k
    _operator_profile->set_metadata(_parent->node_id());
676
94.7k
    _wait_for_finish_dependency_timer =
677
94.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
94.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
94.7k
    if constexpr (!is_fake_shared) {
680
94.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
94.7k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
94.7k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
94.7k
            _shared_state = info.shared_state->template cast<SharedState>();
696
94.7k
            _dependency = _shared_state->create_sink_dependency(
697
94.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
94.7k
        }
699
94.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
94.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
94.7k
    }
702
703
94.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
94.7k
    _rows_input_counter =
708
94.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
94.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
94.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
94.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
94.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
94.7k
    _memory_used_counter =
714
94.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
94.7k
    _common_profile->add_info_string("IsColocate",
716
94.7k
                                     std::to_string(_parent->is_colocated_operator()));
717
94.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
94.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
94.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
94.7k
    return Status::OK();
721
94.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
59.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
59.1k
    _operator_profile =
664
59.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
59.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
59.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
59.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
59.1k
    _operator_profile->add_child(_common_profile, true);
673
59.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
59.1k
    _operator_profile->set_metadata(_parent->node_id());
676
59.1k
    _wait_for_finish_dependency_timer =
677
59.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
59.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
59.1k
    if constexpr (!is_fake_shared) {
680
59.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
59.3k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
59.3k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
59.3k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
59.3k
                                                  ? 0
688
59.3k
                                                  : info.task_idx]
689
59.3k
                                  .get();
690
59.3k
            _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.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
59.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
59.1k
    }
702
703
59.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
59.1k
    _rows_input_counter =
708
59.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
59.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
59.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
59.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
59.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
59.1k
    _memory_used_counter =
714
59.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
59.1k
    _common_profile->add_info_string("IsColocate",
716
59.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
59.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
59.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
59.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
59.1k
    return Status::OK();
721
59.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
170
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
170
    _operator_profile =
664
170
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
170
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
170
    _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
170
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
170
    _operator_profile->add_child(_common_profile, true);
673
170
    _operator_profile->add_child(_custom_profile, true);
674
675
170
    _operator_profile->set_metadata(_parent->node_id());
676
170
    _wait_for_finish_dependency_timer =
677
170
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
170
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
170
    if constexpr (!is_fake_shared) {
680
170
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
170
            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
170
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
170
            _shared_state = info.shared_state->template cast<SharedState>();
696
170
            _dependency = _shared_state->create_sink_dependency(
697
170
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
170
        }
699
170
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
170
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
170
    }
702
703
170
    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
170
    _rows_input_counter =
708
170
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
170
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
170
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
170
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
170
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
170
    _memory_used_counter =
714
170
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
170
    _common_profile->add_info_string("IsColocate",
716
170
                                     std::to_string(_parent->is_colocated_operator()));
717
170
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
170
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
170
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
170
    return Status::OK();
721
170
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
491k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
491k
    _operator_profile =
664
491k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
491k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
491k
    _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
491k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
491k
    _operator_profile->add_child(_common_profile, true);
673
491k
    _operator_profile->add_child(_custom_profile, true);
674
675
491k
    _operator_profile->set_metadata(_parent->node_id());
676
491k
    _wait_for_finish_dependency_timer =
677
491k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
491k
    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
491k
    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
491k
    _rows_input_counter =
708
491k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
491k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
491k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
491k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
491k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
491k
    _memory_used_counter =
714
491k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
491k
    _common_profile->add_info_string("IsColocate",
716
491k
                                     std::to_string(_parent->is_colocated_operator()));
717
491k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
491k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
491k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
491k
    return Status::OK();
721
491k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
9.35k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
9.35k
    _operator_profile =
664
9.35k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
9.35k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
9.35k
    _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.35k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
9.35k
    _operator_profile->add_child(_common_profile, true);
673
9.35k
    _operator_profile->add_child(_custom_profile, true);
674
675
9.35k
    _operator_profile->set_metadata(_parent->node_id());
676
9.35k
    _wait_for_finish_dependency_timer =
677
9.35k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
9.35k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
9.35k
    if constexpr (!is_fake_shared) {
680
9.35k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
9.35k
            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.35k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
9.35k
            _shared_state = info.shared_state->template cast<SharedState>();
696
9.35k
            _dependency = _shared_state->create_sink_dependency(
697
9.35k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
9.35k
        }
699
9.35k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
9.35k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
9.35k
    }
702
703
9.35k
    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.35k
    _rows_input_counter =
708
9.35k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
9.35k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
9.35k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
9.35k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
9.35k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
9.35k
    _memory_used_counter =
714
9.35k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
9.35k
    _common_profile->add_info_string("IsColocate",
716
9.35k
                                     std::to_string(_parent->is_colocated_operator()));
717
9.35k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
9.35k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
9.35k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
9.35k
    return Status::OK();
721
9.35k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
734
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
734
    _operator_profile =
664
734
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
734
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
734
    _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
734
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
734
    _operator_profile->add_child(_common_profile, true);
673
734
    _operator_profile->add_child(_custom_profile, true);
674
675
734
    _operator_profile->set_metadata(_parent->node_id());
676
734
    _wait_for_finish_dependency_timer =
677
734
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
734
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
734
    if constexpr (!is_fake_shared) {
680
734
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
734
            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
734
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
734
            _shared_state = info.shared_state->template cast<SharedState>();
696
734
            _dependency = _shared_state->create_sink_dependency(
697
734
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
734
        }
699
734
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
734
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
734
    }
702
703
736
    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
734
    _rows_input_counter =
708
734
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
734
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
734
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
734
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
734
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
734
    _memory_used_counter =
714
734
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
734
    _common_profile->add_info_string("IsColocate",
716
734
                                     std::to_string(_parent->is_colocated_operator()));
717
734
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
734
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
734
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
734
    return Status::OK();
721
734
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.63k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.63k
    _operator_profile =
664
2.63k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.63k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.63k
    _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.63k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.63k
    _operator_profile->add_child(_common_profile, true);
673
2.63k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.63k
    _operator_profile->set_metadata(_parent->node_id());
676
2.63k
    _wait_for_finish_dependency_timer =
677
2.63k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.63k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.63k
    if constexpr (!is_fake_shared) {
680
2.63k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.63k
            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.63k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.63k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.63k
            _dependency = _shared_state->create_sink_dependency(
697
2.63k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.63k
        }
699
2.63k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.63k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.63k
    }
702
703
2.63k
    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.63k
    _rows_input_counter =
708
2.63k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.63k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.63k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.63k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.63k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.63k
    _memory_used_counter =
714
2.63k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.63k
    _common_profile->add_info_string("IsColocate",
716
2.63k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.63k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.63k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.63k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.63k
    return Status::OK();
721
2.63k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.1k
    _operator_profile =
664
12.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.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
12.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.1k
    _operator_profile->add_child(_common_profile, true);
673
12.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.1k
    _operator_profile->set_metadata(_parent->node_id());
676
12.1k
    _wait_for_finish_dependency_timer =
677
12.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.1k
    if constexpr (!is_fake_shared) {
680
12.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.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
12.1k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.1k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.1k
            _dependency = _shared_state->create_sink_dependency(
697
12.1k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.1k
        }
699
12.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.1k
    }
702
703
12.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
12.1k
    _rows_input_counter =
708
12.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.1k
    _memory_used_counter =
714
12.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.1k
    _common_profile->add_info_string("IsColocate",
716
12.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.1k
    return Status::OK();
721
12.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
226k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
226k
    _operator_profile =
664
226k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
226k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
226k
    _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
226k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
226k
    _operator_profile->add_child(_common_profile, true);
673
226k
    _operator_profile->add_child(_custom_profile, true);
674
675
226k
    _operator_profile->set_metadata(_parent->node_id());
676
226k
    _wait_for_finish_dependency_timer =
677
226k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
226k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
226k
    if constexpr (!is_fake_shared) {
680
226k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
226k
            info.shared_state_map.end()) {
682
225k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
225k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
225k
            }
685
225k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
225k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
225k
                                                  ? 0
688
225k
                                                  : info.task_idx]
689
225k
                                  .get();
690
225k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
225k
        } else {
692
175
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
175
                DCHECK(false);
694
175
            }
695
175
            _shared_state = info.shared_state->template cast<SharedState>();
696
175
            _dependency = _shared_state->create_sink_dependency(
697
175
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
175
        }
699
226k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
226k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
226k
    }
702
703
226k
    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
226k
    _rows_input_counter =
708
226k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
226k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
226k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
226k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
226k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
226k
    _memory_used_counter =
714
226k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
226k
    _common_profile->add_info_string("IsColocate",
716
226k
                                     std::to_string(_parent->is_colocated_operator()));
717
226k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
226k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
226k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
226k
    return Status::OK();
721
226k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
390k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
390k
    _operator_profile =
664
390k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
390k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
390k
    _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
390k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
390k
    _operator_profile->add_child(_common_profile, true);
673
390k
    _operator_profile->add_child(_custom_profile, true);
674
675
390k
    _operator_profile->set_metadata(_parent->node_id());
676
390k
    _wait_for_finish_dependency_timer =
677
390k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
390k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
390k
    if constexpr (!is_fake_shared) {
680
390k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
390k
            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
390k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
390k
            _shared_state = info.shared_state->template cast<SharedState>();
696
390k
            _dependency = _shared_state->create_sink_dependency(
697
390k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
390k
        }
699
390k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
390k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
390k
    }
702
703
390k
    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
390k
    _rows_input_counter =
708
390k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
390k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
390k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
390k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
390k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
390k
    _memory_used_counter =
714
390k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
390k
    _common_profile->add_info_string("IsColocate",
716
390k
                                     std::to_string(_parent->is_colocated_operator()));
717
390k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
390k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
390k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
390k
    return Status::OK();
721
390k
}
_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.64M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.64M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.64M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.14M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.14M
    }
731
1.64M
    _closed = true;
732
1.64M
    return Status::OK();
733
1.64M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
124k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
124k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
124k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
124k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
124k
    }
731
124k
    _closed = true;
732
124k
    return Status::OK();
733
124k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1
    }
731
1
    _closed = true;
732
1
    return Status::OK();
733
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
210k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
210k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
210k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
210k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
210k
    }
731
210k
    _closed = true;
732
210k
    return Status::OK();
733
210k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
25
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
25
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
23
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
23
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
23
    }
731
23
    _closed = true;
732
23
    return Status::OK();
733
25
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.52k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.52k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.52k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.52k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.52k
    }
731
6.52k
    _closed = true;
732
6.52k
    return Status::OK();
733
6.52k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.14k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.14k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.14k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.14k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.14k
    }
731
8.14k
    _closed = true;
732
8.14k
    return Status::OK();
733
8.14k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
94.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
94.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
94.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
94.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
94.6k
    }
731
94.6k
    _closed = true;
732
94.6k
    return Status::OK();
733
94.6k
}
_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
159
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
159
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
159
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
159
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
159
    }
731
159
    _closed = true;
732
159
    return Status::OK();
733
159
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
495k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
495k
    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
495k
    _closed = true;
732
495k
    return Status::OK();
733
495k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
9.40k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
9.40k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
9.40k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
9.40k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
9.40k
    }
731
9.40k
    _closed = true;
732
9.40k
    return Status::OK();
733
9.40k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
629
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
629
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
629
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
629
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
629
    }
731
629
    _closed = true;
732
629
    return Status::OK();
733
629
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.66k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.66k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.66k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.66k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.66k
    }
731
2.66k
    _closed = true;
732
2.66k
    return Status::OK();
733
2.66k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.2k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.2k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.2k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.2k
    }
731
12.2k
    _closed = true;
732
12.2k
    return Status::OK();
733
12.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
227k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
227k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
227k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
227k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
227k
    }
731
227k
    _closed = true;
732
227k
    return Status::OK();
733
227k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
392k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
392k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
392k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
392k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
392k
    }
731
392k
    _closed = true;
732
392k
    return Status::OK();
733
392k
}
_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
8.82k
                                                          bool* eos) {
738
8.82k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
8.81k
    return pull(state, block, eos);
740
8.82k
}
_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
8.78k
                                                          bool* eos) {
738
8.78k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
8.78k
    return pull(state, block, eos);
740
8.78k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
523k
                                                         bool* eos) {
745
523k
    auto& local_state = get_local_state(state);
746
523k
    if (need_more_input_data(state)) {
747
490k
        local_state._child_block->clear_column_data(
748
490k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
490k
                        .num_materialized_slots());
750
490k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
490k
                state, local_state._child_block.get(), &local_state._child_eos));
752
490k
        *eos = local_state._child_eos;
753
490k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
84.0k
            return Status::OK();
755
84.0k
        }
756
406k
        {
757
406k
            SCOPED_TIMER(local_state.exec_time_counter());
758
406k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
406k
        }
760
406k
    }
761
762
439k
    if (!need_more_input_data(state)) {
763
413k
        SCOPED_TIMER(local_state.exec_time_counter());
764
413k
        bool new_eos = false;
765
413k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
413k
        if (new_eos) {
767
334k
            *eos = true;
768
334k
        } else if (!need_more_input_data(state)) {
769
23.6k
            *eos = false;
770
23.6k
        }
771
413k
    }
772
439k
    return Status::OK();
773
439k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
149k
                                                         bool* eos) {
745
149k
    auto& local_state = get_local_state(state);
746
149k
    if (need_more_input_data(state)) {
747
129k
        local_state._child_block->clear_column_data(
748
129k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
129k
                        .num_materialized_slots());
750
129k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
129k
                state, local_state._child_block.get(), &local_state._child_eos));
752
129k
        *eos = local_state._child_eos;
753
129k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
39.2k
            return Status::OK();
755
39.2k
        }
756
90.3k
        {
757
90.3k
            SCOPED_TIMER(local_state.exec_time_counter());
758
90.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
90.3k
        }
760
90.3k
    }
761
762
110k
    if (!need_more_input_data(state)) {
763
110k
        SCOPED_TIMER(local_state.exec_time_counter());
764
110k
        bool new_eos = false;
765
110k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
110k
        if (new_eos) {
767
51.8k
            *eos = true;
768
58.4k
        } else if (!need_more_input_data(state)) {
769
10.4k
            *eos = false;
770
10.4k
        }
771
110k
    }
772
110k
    return Status::OK();
773
110k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.41k
                                                         bool* eos) {
745
4.41k
    auto& local_state = get_local_state(state);
746
4.41k
    if (need_more_input_data(state)) {
747
2.43k
        local_state._child_block->clear_column_data(
748
2.43k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.43k
                        .num_materialized_slots());
750
2.43k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.43k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.43k
        *eos = local_state._child_eos;
753
2.43k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
462
            return Status::OK();
755
462
        }
756
1.97k
        {
757
1.97k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.97k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.97k
        }
760
1.97k
    }
761
762
3.95k
    if (!need_more_input_data(state)) {
763
3.95k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.95k
        bool new_eos = false;
765
3.95k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.95k
        if (new_eos) {
767
1.35k
            *eos = true;
768
2.60k
        } else if (!need_more_input_data(state)) {
769
1.97k
            *eos = false;
770
1.97k
        }
771
3.95k
    }
772
3.94k
    return Status::OK();
773
3.94k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.84k
                                                         bool* eos) {
745
1.84k
    auto& local_state = get_local_state(state);
746
1.84k
    if (need_more_input_data(state)) {
747
1.84k
        local_state._child_block->clear_column_data(
748
1.84k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.84k
                        .num_materialized_slots());
750
1.84k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.84k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.84k
        *eos = local_state._child_eos;
753
1.84k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
764
            return Status::OK();
755
764
        }
756
1.08k
        {
757
1.08k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.08k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.08k
        }
760
1.08k
    }
761
762
1.08k
    if (!need_more_input_data(state)) {
763
1.08k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.08k
        bool new_eos = false;
765
1.08k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.08k
        if (new_eos) {
767
786
            *eos = true;
768
786
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.08k
    }
772
1.08k
    return Status::OK();
773
1.08k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
18.9k
                                                         bool* eos) {
745
18.9k
    auto& local_state = get_local_state(state);
746
18.9k
    if (need_more_input_data(state)) {
747
18.9k
        local_state._child_block->clear_column_data(
748
18.9k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
18.9k
                        .num_materialized_slots());
750
18.9k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
18.9k
                state, local_state._child_block.get(), &local_state._child_eos));
752
18.9k
        *eos = local_state._child_eos;
753
18.9k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
4.54k
            return Status::OK();
755
4.54k
        }
756
14.3k
        {
757
14.3k
            SCOPED_TIMER(local_state.exec_time_counter());
758
14.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
14.3k
        }
760
14.3k
    }
761
762
14.4k
    if (!need_more_input_data(state)) {
763
7.55k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.55k
        bool new_eos = false;
765
7.55k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.55k
        if (new_eos) {
767
7.43k
            *eos = true;
768
7.43k
        } else if (!need_more_input_data(state)) {
769
34
            *eos = false;
770
34
        }
771
7.55k
    }
772
14.4k
    return Status::OK();
773
14.4k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
317k
                                                         bool* eos) {
745
317k
    auto& local_state = get_local_state(state);
746
318k
    if (need_more_input_data(state)) {
747
318k
        local_state._child_block->clear_column_data(
748
318k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
318k
                        .num_materialized_slots());
750
318k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
318k
                state, local_state._child_block.get(), &local_state._child_eos));
752
318k
        *eos = local_state._child_eos;
753
318k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
37.3k
            return Status::OK();
755
37.3k
        }
756
280k
        {
757
280k
            SCOPED_TIMER(local_state.exec_time_counter());
758
280k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
280k
        }
760
280k
    }
761
762
280k
    if (!need_more_input_data(state)) {
763
261k
        SCOPED_TIMER(local_state.exec_time_counter());
764
261k
        bool new_eos = false;
765
261k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
261k
        if (new_eos) {
767
261k
            *eos = true;
768
261k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
261k
    }
772
280k
    return Status::OK();
773
280k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
22.7k
                                                         bool* eos) {
745
22.7k
    auto& local_state = get_local_state(state);
746
22.7k
    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
736
            return Status::OK();
755
736
        }
756
11.1k
        {
757
11.1k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.1k
        }
760
11.1k
    }
761
762
21.9k
    if (!need_more_input_data(state)) {
763
21.3k
        SCOPED_TIMER(local_state.exec_time_counter());
764
21.3k
        bool new_eos = false;
765
21.3k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
21.3k
        if (new_eos) {
767
6.50k
            *eos = true;
768
14.7k
        } else if (!need_more_input_data(state)) {
769
10.7k
            *eos = false;
770
10.7k
        }
771
21.3k
    }
772
21.9k
    return Status::OK();
773
21.9k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
8.22k
                                                         bool* eos) {
745
8.22k
    auto& local_state = get_local_state(state);
746
8.22k
    if (need_more_input_data(state)) {
747
7.86k
        local_state._child_block->clear_column_data(
748
7.86k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
7.86k
                        .num_materialized_slots());
750
7.86k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
7.86k
                state, local_state._child_block.get(), &local_state._child_eos));
752
7.86k
        *eos = local_state._child_eos;
753
7.86k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.01k
            return Status::OK();
755
1.01k
        }
756
6.84k
        {
757
6.84k
            SCOPED_TIMER(local_state.exec_time_counter());
758
6.84k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
6.84k
        }
760
6.84k
    }
761
762
7.21k
    if (!need_more_input_data(state)) {
763
7.21k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.21k
        bool new_eos = false;
765
7.21k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.21k
        if (new_eos) {
767
5.04k
            *eos = true;
768
5.04k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
7.21k
    }
772
7.20k
    return Status::OK();
773
7.20k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
47.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.7k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.7k
                                                         "AsyncWriterDependency", true);
781
47.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.7k
                             _finish_dependency));
783
784
47.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.7k
    return Status::OK();
787
47.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
351
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
351
    RETURN_IF_ERROR(Base::init(state, info));
779
351
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
351
                                                         "AsyncWriterDependency", true);
781
351
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
351
                             _finish_dependency));
783
784
351
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
351
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
351
    return Status::OK();
787
351
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
47.3k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.3k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.3k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.3k
                                                         "AsyncWriterDependency", true);
781
47.3k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.3k
                             _finish_dependency));
783
784
47.3k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.3k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.3k
    return Status::OK();
787
47.3k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
34
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
34
    RETURN_IF_ERROR(Base::init(state, info));
779
34
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
34
                                                         "AsyncWriterDependency", true);
781
34
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
34
                             _finish_dependency));
783
784
34
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
34
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
34
    return Status::OK();
787
34
}
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
48.5k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
48.5k
    RETURN_IF_ERROR(Base::open(state));
793
48.5k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
389k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
341k
        RETURN_IF_ERROR(
796
341k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
341k
    }
798
48.5k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
48.5k
    return Status::OK();
800
48.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
351
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
351
    RETURN_IF_ERROR(Base::open(state));
793
351
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.82k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.47k
        RETURN_IF_ERROR(
796
1.47k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.47k
    }
798
351
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
351
    return Status::OK();
800
351
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
48.1k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
48.1k
    RETURN_IF_ERROR(Base::open(state));
793
48.1k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
387k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
338k
        RETURN_IF_ERROR(
796
338k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
338k
    }
798
48.1k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
48.1k
    return Status::OK();
800
48.1k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
34
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
34
    RETURN_IF_ERROR(Base::open(state));
793
34
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
612
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
578
        RETURN_IF_ERROR(
796
578
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
578
    }
798
34
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
34
    return Status::OK();
800
34
}
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
63.9k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
63.9k
    return _writer->sink(block, eos);
806
63.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.63k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.63k
    return _writer->sink(block, eos);
806
1.63k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
62.2k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.2k
    return _writer->sink(block, eos);
806
62.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
34
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
34
    return _writer->sink(block, eos);
806
34
}
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
48.5k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
48.5k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
48.5k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
48.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
48.6k
    if (_writer) {
818
48.6k
        Status st = _writer->get_writer_status();
819
48.6k
        if (exec_status.ok()) {
820
48.5k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
48.5k
                                                       : Status::Cancelled("force close"));
822
48.5k
        } else {
823
70
            _writer->force_close(exec_status);
824
70
        }
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
48.6k
        RETURN_IF_ERROR(st);
829
48.6k
    }
830
48.5k
    return Base::close(state, exec_status);
831
48.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
339
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
339
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
339
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
339
    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
339
    if (_writer) {
818
339
        Status st = _writer->get_writer_status();
819
339
        if (exec_status.ok()) {
820
339
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
339
                                                       : Status::Cancelled("force close"));
822
339
        } 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
339
        RETURN_IF_ERROR(st);
829
339
    }
830
339
    return Base::close(state, exec_status);
831
339
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
48.1k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
48.1k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
48.1k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
48.1k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
48.2k
    if (_writer) {
818
48.2k
        Status st = _writer->get_writer_status();
819
48.2k
        if (exec_status.ok()) {
820
48.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
48.1k
                                                       : Status::Cancelled("force close"));
822
48.1k
        } else {
823
70
            _writer->force_close(exec_status);
824
70
        }
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
48.2k
        RETURN_IF_ERROR(st);
829
48.2k
    }
830
48.1k
    return Base::close(state, exec_status);
831
48.1k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
34
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
34
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
34
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
34
    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
34
    if (_writer) {
818
34
        Status st = _writer->get_writer_status();
819
34
        if (exec_status.ok()) {
820
34
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
34
                                                       : Status::Cancelled("force close"));
822
34
        } 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
34
        RETURN_IF_ERROR(st);
829
34
    }
830
34
    return Base::close(state, exec_status);
831
34
}
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