Coverage Report

Created: 2026-07-27 07:04

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
2.23M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
2.23M
    if (_parent->nereids_id() == -1) {
122
1.18M
        return fmt::format("(id={})", _parent->node_id());
123
1.18M
    } else {
124
1.04M
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
1.04M
    }
126
2.23M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
75.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
75.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
75.1k
    } else {
124
75.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
75.1k
    }
126
75.1k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1
    if (_parent->nereids_id() == -1) {
122
1
        return fmt::format("(id={})", _parent->node_id());
123
1
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
250k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
250k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
250k
    } else {
124
250k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
250k
    }
126
250k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
22
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
22
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
22
    } else {
124
22
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
22
    }
126
22
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
10.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
10.8k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
10.8k
    } else {
124
10.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
10.8k
    }
126
10.8k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.94k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.94k
    if (_parent->nereids_id() == -1) {
122
11
        return fmt::format("(id={})", _parent->node_id());
123
8.93k
    } else {
124
8.93k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.93k
    }
126
8.94k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
160k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
160k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
160k
    } else {
124
160k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
160k
    }
126
160k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
482
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
482
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
482
    } else {
124
482
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
482
    }
126
482
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
153
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
153
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
153
    } else {
124
153
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
153
    }
126
153
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
878k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
878k
    if (_parent->nereids_id() == -1) {
122
400k
        return fmt::format("(id={})", _parent->node_id());
123
477k
    } else {
124
477k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
477k
    }
126
878k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
55.7k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
55.7k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
55.7k
    } else {
124
55.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
55.7k
    }
126
55.7k
}
_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
9.99k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
9.99k
    if (_parent->nereids_id() == -1) {
122
9.99k
        return fmt::format("(id={})", _parent->node_id());
123
9.99k
    } else {
124
3
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
3
    }
126
9.99k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
424
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
424
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
322
    } else {
124
322
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
322
    }
126
424
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.10k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.10k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.08k
    } else {
124
5.08k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.08k
    }
126
5.10k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
775k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
775k
    if (_parent->nereids_id() == -1) {
122
774k
        return fmt::format("(id={})", _parent->node_id());
123
774k
    } else {
124
1.03k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
1.03k
    }
126
775k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
164
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
164
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
164
    } else {
124
164
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
164
    }
126
164
}
127
128
template <typename SharedStateArg>
129
1.40M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.40M
    if (_parent->nereids_id() == -1) {
131
842k
        return fmt::format("(id={})", _parent->node_id());
132
842k
    } else {
133
563k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
563k
    }
135
1.40M
}
_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
253k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
253k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
253k
    } else {
133
253k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
253k
    }
135
253k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
29
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
29
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
29
    } else {
133
29
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
29
    }
135
29
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
10.8k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
10.8k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
10.8k
    } else {
133
10.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
10.8k
    }
135
10.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.94k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.94k
    if (_parent->nereids_id() == -1) {
131
11
        return fmt::format("(id={})", _parent->node_id());
132
8.93k
    } else {
133
8.93k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.93k
    }
135
8.94k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
160k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
160k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
160k
    } else {
133
160k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
160k
    }
135
160k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
480
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
480
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
480
    } else {
133
480
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
480
    }
135
480
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
163
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
163
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
163
    } else {
133
163
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
163
    }
135
163
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
131
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
131
    if (_parent->nereids_id() == -1) {
131
131
        return fmt::format("(id={})", _parent->node_id());
132
131
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
131
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.41k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.41k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
5.40k
    } else {
133
5.40k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.40k
    }
135
5.41k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
423
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
423
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
321
    } else {
133
321
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
321
    }
135
423
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.4k
    if (_parent->nereids_id() == -1) {
131
12.4k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
310k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
311k
    if (_parent->nereids_id() == -1) {
131
311k
        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
310k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
519k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
519k
    if (_parent->nereids_id() == -1) {
131
518k
        return fmt::format("(id={})", _parent->node_id());
132
518k
    } else {
133
228
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
228
    }
135
519k
}
_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
328
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
328
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
328
    } else {
133
328
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
328
    }
135
328
}
136
137
template <typename SharedStateArg>
138
30.6k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
30.6k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
30.6k
    _terminated = true;
143
30.6k
    return Status::OK();
144
30.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.64k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.64k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.64k
    _terminated = true;
143
1.64k
    return Status::OK();
144
1.64k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_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_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3.35k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3.35k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3.35k
    _terminated = true;
143
3.35k
    return Status::OK();
144
3.35k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
22
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
22
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
22
    _terminated = true;
143
22
    return Status::OK();
144
22
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
429
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
429
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
429
    _terminated = true;
143
429
    return Status::OK();
144
429
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
15
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
15
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
15
    _terminated = true;
143
15
    return Status::OK();
144
15
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_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_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
825
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
825
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
825
    _terminated = true;
143
825
    return Status::OK();
144
825
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
12
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
12
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
12
    _terminated = true;
143
12
    return Status::OK();
144
12
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
172
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
172
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
172
    _terminated = true;
143
172
    return Status::OK();
144
172
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
139
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
139
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
139
    _terminated = true;
143
139
    return Status::OK();
144
139
}
145
146
439k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
439k
    return _child && _child->is_serial_operator() && !is_source()
148
439k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
439k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
439k
}
151
152
33.7k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
33.7k
    if (!_child) {
154
28.4k
        return false;
155
28.4k
    }
156
5.26k
    if (_child->is_serial_operator()) {
157
165
        return true;
158
165
    }
159
5.10k
    const auto child_distribution = _child->required_data_distribution(state);
160
5.10k
    return child_distribution.need_local_exchange() &&
161
5.10k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
5.26k
}
163
164
82.7k
const RowDescriptor& OperatorBase::row_desc() const {
165
82.7k
    return _child->row_desc();
166
82.7k
}
167
168
template <typename SharedStateArg>
169
19.1k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
19.1k
    fmt::memory_buffer debug_string_buffer;
171
19.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
19.1k
    return fmt::to_string(debug_string_buffer);
173
19.1k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
3
    fmt::memory_buffer debug_string_buffer;
171
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
3
    return fmt::to_string(debug_string_buffer);
173
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
169
19.1k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
19.1k
    fmt::memory_buffer debug_string_buffer;
171
19.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
19.1k
    return fmt::to_string(debug_string_buffer);
173
19.1k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
1
    fmt::memory_buffer debug_string_buffer;
171
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
1
    return fmt::to_string(debug_string_buffer);
173
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
174
175
template <typename SharedStateArg>
176
19.1k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
19.1k
    fmt::memory_buffer debug_string_buffer;
178
19.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
19.1k
    return fmt::to_string(debug_string_buffer);
180
19.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
176
19.1k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
19.1k
    fmt::memory_buffer debug_string_buffer;
178
19.1k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
19.1k
    return fmt::to_string(debug_string_buffer);
180
19.1k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
181
182
19.1k
std::string OperatorXBase::debug_string(int indentation_level) const {
183
19.1k
    fmt::memory_buffer debug_string_buffer;
184
19.1k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
185
19.1k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
186
19.1k
                   _is_serial_operator);
187
19.1k
    return fmt::to_string(debug_string_buffer);
188
19.1k
}
189
190
19.1k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
191
19.1k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
192
19.1k
}
193
194
857k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
195
857k
    std::string node_name = print_plan_node_type(tnode.node_type);
196
857k
    _nereids_id = tnode.nereids_id;
197
857k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
198
4.17k
        if (!tnode.__isset.output_tuple_id) {
199
0
            return Status::InternalError("no final output tuple id");
200
0
        }
201
4.17k
        if (tnode.intermediate_output_tuple_id_list.size() !=
202
4.17k
            tnode.intermediate_projections_list.size()) {
203
0
            return Status::InternalError(
204
0
                    "intermediate_output_tuple_id_list size:{} not match "
205
0
                    "intermediate_projections_list size:{}",
206
0
                    tnode.intermediate_output_tuple_id_list.size(),
207
0
                    tnode.intermediate_projections_list.size());
208
0
        }
209
4.17k
    }
210
857k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
211
857k
    _op_name = substr + "_OPERATOR";
212
213
857k
    if (tnode.__isset.vconjunct) {
214
0
        return Status::InternalError("vconjunct is not supported yet");
215
857k
    } else if (tnode.__isset.conjuncts) {
216
481k
        for (const auto& conjunct : tnode.conjuncts) {
217
481k
            VExprContextSPtr context;
218
481k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
219
481k
            _conjuncts.emplace_back(context);
220
481k
        }
221
155k
    }
222
223
    // create the projections expr
224
857k
    if (tnode.__isset.projections) {
225
332k
        DCHECK(tnode.__isset.output_tuple_id);
226
332k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
227
332k
    }
228
857k
    if (!tnode.intermediate_projections_list.empty()) {
229
4.17k
        DCHECK(tnode.__isset.projections) << "no final projections";
230
4.17k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
231
8.64k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
232
8.64k
            VExprContextSPtrs projections;
233
8.64k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
234
8.64k
            _intermediate_projections.push_back(projections);
235
8.64k
        }
236
4.17k
    }
237
857k
    return Status::OK();
238
857k
}
239
240
889k
Status OperatorXBase::prepare(RuntimeState* state) {
241
889k
    for (auto& conjunct : _conjuncts) {
242
480k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
243
480k
    }
244
889k
    if (state->enable_adjust_conjunct_order_by_cost()) {
245
836k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
246
638k
            return a->execute_cost() < b->execute_cost();
247
638k
        });
248
836k
    };
249
250
898k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
251
8.64k
        RETURN_IF_ERROR(
252
8.64k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
253
8.64k
    }
254
889k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
255
256
889k
    if (has_output_row_desc()) {
257
332k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
258
332k
    }
259
260
889k
    for (auto& conjunct : _conjuncts) {
261
481k
        RETURN_IF_ERROR(conjunct->open(state));
262
481k
    }
263
889k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
264
889k
    for (auto& projections : _intermediate_projections) {
265
8.64k
        RETURN_IF_ERROR(VExpr::open(projections, state));
266
8.64k
    }
267
889k
    if (_child && !is_source()) {
268
135k
        RETURN_IF_ERROR(_child->prepare(state));
269
135k
    }
270
271
889k
    if (VExpr::contains_blockable_function(_conjuncts) ||
272
889k
        VExpr::contains_blockable_function(_projections)) {
273
0
        _blockable = true;
274
0
    }
275
276
889k
    return Status::OK();
277
889k
}
278
279
8.00k
Status OperatorXBase::terminate(RuntimeState* state) {
280
8.00k
    if (_child && !is_source()) {
281
1.37k
        RETURN_IF_ERROR(_child->terminate(state));
282
1.37k
    }
283
8.00k
    auto result = state->get_local_state_result(operator_id());
284
8.00k
    if (!result) {
285
0
        return result.error();
286
0
    }
287
8.00k
    return result.value()->terminate(state);
288
8.00k
}
289
290
6.27M
Status OperatorXBase::close(RuntimeState* state) {
291
6.27M
    if (_child && !is_source()) {
292
1.11M
        RETURN_IF_ERROR(_child->close(state));
293
1.11M
    }
294
6.27M
    auto result = state->get_local_state_result(operator_id());
295
6.27M
    if (!result) {
296
0
        return result.error();
297
0
    }
298
6.27M
    return result.value()->close(state);
299
6.27M
}
300
301
311k
void PipelineXLocalStateBase::clear_origin_block() {
302
311k
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
303
311k
}
304
305
629k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
306
629k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
307
308
629k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
309
629k
    return Status::OK();
310
629k
}
311
312
0
bool PipelineXLocalStateBase::is_blockable() const {
313
0
    return std::any_of(_projections.begin(), _projections.end(),
314
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
315
0
}
316
317
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
318
311k
                                     Block* output_block) const {
319
311k
    auto* local_state = state->get_local_state(operator_id());
320
311k
    SCOPED_TIMER(local_state->exec_time_counter());
321
311k
    SCOPED_TIMER(local_state->_projection_timer);
322
311k
    const size_t rows = origin_block->rows();
323
311k
    if (rows == 0) {
324
165k
        return Status::OK();
325
165k
    }
326
145k
    Block input_block = *origin_block;
327
328
145k
    size_t bytes_usage = 0;
329
145k
    ColumnsWithTypeAndName new_columns;
330
145k
    for (const auto& projections : local_state->_intermediate_projections) {
331
1.83k
        if (projections.empty()) {
332
0
            return Status::InternalError("meet empty intermediate projection, node id: {}",
333
0
                                         node_id());
334
0
        }
335
1.83k
        new_columns.resize(projections.size());
336
14.4k
        for (int i = 0; i < projections.size(); i++) {
337
12.6k
            RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
338
12.6k
            if (new_columns[i].column->size() != rows) {
339
0
                return Status::InternalError(
340
0
                        "intermediate projection result column size {} not equal input rows {}, "
341
0
                        "expr: {}",
342
0
                        new_columns[i].column->size(), rows,
343
0
                        projections[i]->root()->debug_string());
344
0
            }
345
12.6k
        }
346
1.83k
        Block tmp_block {new_columns};
347
1.83k
        bytes_usage += tmp_block.allocated_bytes();
348
1.83k
        input_block.swap(tmp_block);
349
1.83k
    }
350
351
145k
    if (input_block.rows() != rows) {
352
0
        return Status::InternalError(
353
0
                "after intermediate projections input block rows {} not equal origin rows {}, "
354
0
                "input_block: {}",
355
0
                input_block.rows(), rows, input_block.dump_structure());
356
0
    }
357
690k
    auto insert_column_datas = [&](auto& to, ColumnPtr& from, size_t rows) {
358
690k
        if (is_column_nullable(*to) && !is_column_nullable(*from)) {
359
0
            if (_keep_origin || !from->is_exclusive()) {
360
0
                auto& null_column = reinterpret_cast<ColumnNullable&>(*to);
361
0
                null_column.get_nested_column().insert_range_from(*from, 0, rows);
362
0
                null_column.get_null_map_column().get_data().resize_fill(rows, 0);
363
0
                bytes_usage += null_column.allocated_bytes();
364
0
            } else {
365
0
                to = make_nullable(from, false)->assert_mutable();
366
0
            }
367
690k
        } else {
368
690k
            if (_keep_origin || !from->is_exclusive()) {
369
690k
                to->insert_range_from(*from, 0, rows);
370
690k
                bytes_usage += from->allocated_bytes();
371
18.4E
            } else {
372
18.4E
                to = from->assert_mutable();
373
18.4E
            }
374
690k
        }
375
690k
    };
376
377
145k
    auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
378
145k
            output_block, *_output_row_descriptor);
379
145k
    auto& mutable_block = scoped_mutable_block.mutable_block();
380
145k
    auto& mutable_columns = mutable_block.mutable_columns();
381
145k
    if (rows != 0) {
382
145k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
383
836k
        for (int i = 0; i < mutable_columns.size(); ++i) {
384
690k
            ColumnPtr column_ptr;
385
690k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
386
690k
            if (column_ptr->size() != rows) {
387
0
                return Status::InternalError(
388
0
                        "projection result column size {} not equal input rows {}, expr: {}",
389
0
                        column_ptr->size(), rows,
390
0
                        local_state->_projections[i]->root()->debug_string());
391
0
            }
392
690k
            column_ptr = column_ptr->convert_to_full_column_if_const();
393
690k
            bytes_usage += column_ptr->allocated_bytes();
394
690k
            insert_column_datas(mutable_columns[i], column_ptr, rows);
395
690k
        }
396
145k
        DCHECK(mutable_block.rows() == rows);
397
145k
    }
398
145k
    local_state->_estimate_memory_usage += bytes_usage;
399
400
145k
    return Status::OK();
401
145k
}
402
403
4.85M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
404
4.85M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
405
4.85M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
406
4.85M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
407
4.85M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
408
4.85M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
409
4.85M
            if (_debug_point_count++ % 2 == 0) {
410
4.85M
                return Status::OK();
411
4.85M
            }
412
4.85M
        }
413
4.85M
    });
414
415
4.85M
    Status status;
416
4.85M
    auto* local_state = state->get_local_state(operator_id());
417
4.85M
    Defer defer([&]() {
418
4.85M
        if (status.ok()) {
419
4.85M
            local_state->update_output_block_counters(*block);
420
4.85M
        }
421
4.85M
    });
422
4.85M
    if (_output_row_descriptor) {
423
311k
        local_state->clear_origin_block();
424
311k
        status = get_block(state, &local_state->_origin_block, eos);
425
311k
        if (UNLIKELY(!status.ok())) {
426
22
            return status;
427
22
        }
428
311k
        status = do_projections(state, &local_state->_origin_block, block);
429
311k
        return status;
430
311k
    }
431
4.54M
    status = get_block(state, block, eos);
432
4.54M
    RETURN_IF_ERROR(block->check_type_and_column());
433
4.54M
    return status;
434
4.54M
}
435
436
3.28M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
437
3.28M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
438
7.02k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
439
7.02k
        *eos = true;
440
7.02k
    }
441
442
3.28M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
443
3.28M
        auto op_name = to_lower(_parent->_op_name);
444
3.28M
        auto arg_op_name = dp->param<std::string>("op_name");
445
3.28M
        arg_op_name = to_lower(arg_op_name);
446
447
3.28M
        if (op_name == arg_op_name) {
448
3.28M
            *eos = true;
449
3.28M
        }
450
3.28M
    });
451
452
3.28M
    if (auto rows = block->rows()) {
453
948k
        _num_rows_returned += rows;
454
948k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
455
948k
    }
456
3.28M
}
457
458
30.6k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
459
30.6k
    auto result = state->get_sink_local_state_result();
460
30.6k
    if (!result) {
461
0
        return result.error();
462
0
    }
463
30.6k
    return result.value()->terminate(state);
464
30.6k
}
465
466
19.1k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
467
19.1k
    fmt::memory_buffer debug_string_buffer;
468
469
19.1k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
470
19.1k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
471
19.1k
    return fmt::to_string(debug_string_buffer);
472
19.1k
}
473
474
19.1k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
475
19.1k
    return state->get_sink_local_state()->debug_string(indentation_level);
476
19.1k
}
477
478
475k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
479
475k
    std::string op_name = "UNKNOWN_SINK";
480
475k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
481
482
477k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
483
477k
        op_name = it->second;
484
477k
    }
485
475k
    _name = op_name + "_OPERATOR";
486
475k
    return Status::OK();
487
475k
}
488
489
324k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
490
324k
    std::string op_name = print_plan_node_type(tnode.node_type);
491
324k
    _nereids_id = tnode.nereids_id;
492
324k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
493
324k
    _name = substr + "_SINK_OPERATOR";
494
324k
    return Status::OK();
495
324k
}
496
497
template <typename LocalStateType>
498
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
499
2.12M
                                                            LocalSinkStateInfo& info) {
500
2.12M
    auto local_state = LocalStateType::create_unique(this, state);
501
2.12M
    RETURN_IF_ERROR(local_state->init(state, info));
502
2.12M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
2.12M
    return Status::OK();
504
2.12M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
123k
                                                            LocalSinkStateInfo& info) {
500
123k
    auto local_state = LocalStateType::create_unique(this, state);
501
123k
    RETURN_IF_ERROR(local_state->init(state, info));
502
123k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
123k
    return Status::OK();
504
123k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
451k
                                                            LocalSinkStateInfo& info) {
500
451k
    auto local_state = LocalStateType::create_unique(this, state);
501
451k
    RETURN_IF_ERROR(local_state->init(state, info));
502
451k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
451k
    return Status::OK();
504
451k
}
_ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
86
                                                            LocalSinkStateInfo& info) {
500
86
    auto local_state = LocalStateType::create_unique(this, state);
501
86
    RETURN_IF_ERROR(local_state->init(state, info));
502
86
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
86
    return Status::OK();
504
86
}
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
3
                                                            LocalSinkStateInfo& info) {
500
3
    auto local_state = LocalStateType::create_unique(this, state);
501
3
    RETURN_IF_ERROR(local_state->init(state, info));
502
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
3
    return Status::OK();
504
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
523
                                                            LocalSinkStateInfo& info) {
500
523
    auto local_state = LocalStateType::create_unique(this, state);
501
523
    RETURN_IF_ERROR(local_state->init(state, info));
502
523
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
523
    return Status::OK();
504
523
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
47.8k
                                                            LocalSinkStateInfo& info) {
500
47.8k
    auto local_state = LocalStateType::create_unique(this, state);
501
47.8k
    RETURN_IF_ERROR(local_state->init(state, info));
502
47.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
47.8k
    return Status::OK();
504
47.8k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
9.59k
                                                            LocalSinkStateInfo& info) {
500
9.59k
    auto local_state = LocalStateType::create_unique(this, state);
501
9.59k
    RETURN_IF_ERROR(local_state->init(state, info));
502
9.59k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
9.59k
    return Status::OK();
504
9.59k
}
_ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
5.04k
                                                            LocalSinkStateInfo& info) {
500
5.04k
    auto local_state = LocalStateType::create_unique(this, state);
501
5.04k
    RETURN_IF_ERROR(local_state->init(state, info));
502
5.04k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
5.04k
    return Status::OK();
504
5.04k
}
_ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
156
                                                            LocalSinkStateInfo& info) {
500
156
    auto local_state = LocalStateType::create_unique(this, state);
501
156
    RETURN_IF_ERROR(local_state->init(state, info));
502
156
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
156
    return Status::OK();
504
156
}
_ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
4.00k
                                                            LocalSinkStateInfo& info) {
500
4.00k
    auto local_state = LocalStateType::create_unique(this, state);
501
4.00k
    RETURN_IF_ERROR(local_state->init(state, info));
502
4.00k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
4.00k
    return Status::OK();
504
4.00k
}
_ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
48
                                                            LocalSinkStateInfo& info) {
500
48
    auto local_state = LocalStateType::create_unique(this, state);
501
48
    RETURN_IF_ERROR(local_state->init(state, info));
502
48
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
48
    return Status::OK();
504
48
}
_ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
704
                                                            LocalSinkStateInfo& info) {
500
704
    auto local_state = LocalStateType::create_unique(this, state);
501
704
    RETURN_IF_ERROR(local_state->init(state, info));
502
704
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
704
    return Status::OK();
504
704
}
_ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
1.68k
                                                            LocalSinkStateInfo& info) {
500
1.68k
    auto local_state = LocalStateType::create_unique(this, state);
501
1.68k
    RETURN_IF_ERROR(local_state->init(state, info));
502
1.68k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
1.68k
    return Status::OK();
504
1.68k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
8.95k
                                                            LocalSinkStateInfo& info) {
500
8.95k
    auto local_state = LocalStateType::create_unique(this, state);
501
8.95k
    RETURN_IF_ERROR(local_state->init(state, info));
502
8.95k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
8.95k
    return Status::OK();
504
8.95k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
128
                                                            LocalSinkStateInfo& info) {
500
128
    auto local_state = LocalStateType::create_unique(this, state);
501
128
    RETURN_IF_ERROR(local_state->init(state, info));
502
128
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
128
    return Status::OK();
504
128
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
253k
                                                            LocalSinkStateInfo& info) {
500
253k
    auto local_state = LocalStateType::create_unique(this, state);
501
253k
    RETURN_IF_ERROR(local_state->init(state, info));
502
253k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
253k
    return Status::OK();
504
253k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
29
                                                            LocalSinkStateInfo& info) {
500
29
    auto local_state = LocalStateType::create_unique(this, state);
501
29
    RETURN_IF_ERROR(local_state->init(state, info));
502
29
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
29
    return Status::OK();
504
29
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
311k
                                                            LocalSinkStateInfo& info) {
500
311k
    auto local_state = LocalStateType::create_unique(this, state);
501
311k
    RETURN_IF_ERROR(local_state->init(state, info));
502
311k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
311k
    return Status::OK();
504
311k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
160k
                                                            LocalSinkStateInfo& info) {
500
160k
    auto local_state = LocalStateType::create_unique(this, state);
501
160k
    RETURN_IF_ERROR(local_state->init(state, info));
502
160k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
160k
    return Status::OK();
504
160k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
479
                                                            LocalSinkStateInfo& info) {
500
479
    auto local_state = LocalStateType::create_unique(this, state);
501
479
    RETURN_IF_ERROR(local_state->init(state, info));
502
479
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
479
    return Status::OK();
504
479
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
163
                                                            LocalSinkStateInfo& info) {
500
163
    auto local_state = LocalStateType::create_unique(this, state);
501
163
    RETURN_IF_ERROR(local_state->init(state, info));
502
163
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
163
    return Status::OK();
504
163
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
706k
                                                            LocalSinkStateInfo& info) {
500
706k
    auto local_state = LocalStateType::create_unique(this, state);
501
706k
    RETURN_IF_ERROR(local_state->init(state, info));
502
706k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
706k
    return Status::OK();
504
706k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
10.8k
                                                            LocalSinkStateInfo& info) {
500
10.8k
    auto local_state = LocalStateType::create_unique(this, state);
501
10.8k
    RETURN_IF_ERROR(local_state->init(state, info));
502
10.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
10.8k
    return Status::OK();
504
10.8k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
5.40k
                                                            LocalSinkStateInfo& info) {
500
5.40k
    auto local_state = LocalStateType::create_unique(this, state);
501
5.40k
    RETURN_IF_ERROR(local_state->init(state, info));
502
5.40k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
5.40k
    return Status::OK();
504
5.40k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
3.57k
                                                            LocalSinkStateInfo& info) {
500
3.57k
    auto local_state = LocalStateType::create_unique(this, state);
501
3.57k
    RETURN_IF_ERROR(local_state->init(state, info));
502
3.57k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
3.57k
    return Status::OK();
504
3.57k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
323
                                                            LocalSinkStateInfo& info) {
500
323
    auto local_state = LocalStateType::create_unique(this, state);
501
323
    RETURN_IF_ERROR(local_state->init(state, info));
502
323
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
323
    return Status::OK();
504
323
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
4.80k
                                                            LocalSinkStateInfo& info) {
500
4.80k
    auto local_state = LocalStateType::create_unique(this, state);
501
4.80k
    RETURN_IF_ERROR(local_state->init(state, info));
502
4.80k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
4.80k
    return Status::OK();
504
4.80k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
2.53k
                                                            LocalSinkStateInfo& info) {
500
2.53k
    auto local_state = LocalStateType::create_unique(this, state);
501
2.53k
    RETURN_IF_ERROR(local_state->init(state, info));
502
2.53k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
2.53k
    return Status::OK();
504
2.53k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
2.60k
                                                            LocalSinkStateInfo& info) {
500
2.60k
    auto local_state = LocalStateType::create_unique(this, state);
501
2.60k
    RETURN_IF_ERROR(local_state->init(state, info));
502
2.60k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
2.60k
    return Status::OK();
504
2.60k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
2.45k
                                                            LocalSinkStateInfo& info) {
500
2.45k
    auto local_state = LocalStateType::create_unique(this, state);
501
2.45k
    RETURN_IF_ERROR(local_state->init(state, info));
502
2.45k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
2.45k
    return Status::OK();
504
2.45k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
1
                                                            LocalSinkStateInfo& info) {
500
1
    auto local_state = LocalStateType::create_unique(this, state);
501
1
    RETURN_IF_ERROR(local_state->init(state, info));
502
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
1
    return Status::OK();
504
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
567
                                                            LocalSinkStateInfo& info) {
500
567
    auto local_state = LocalStateType::create_unique(this, state);
501
567
    RETURN_IF_ERROR(local_state->init(state, info));
502
567
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
567
    return Status::OK();
504
567
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
14
                                                            LocalSinkStateInfo& info) {
500
14
    auto local_state = LocalStateType::create_unique(this, state);
501
14
    RETURN_IF_ERROR(local_state->init(state, info));
502
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
14
    return Status::OK();
504
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
105
                                                            LocalSinkStateInfo& info) {
500
105
    auto local_state = LocalStateType::create_unique(this, state);
501
105
    RETURN_IF_ERROR(local_state->init(state, info));
502
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
105
    return Status::OK();
504
105
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
164
                                                            LocalSinkStateInfo& info) {
500
164
    auto local_state = LocalStateType::create_unique(this, state);
501
164
    RETURN_IF_ERROR(local_state->init(state, info));
502
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
164
    return Status::OK();
504
164
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
499
164
                                                            LocalSinkStateInfo& info) {
500
164
    auto local_state = LocalStateType::create_unique(this, state);
501
164
    RETURN_IF_ERROR(local_state->init(state, info));
502
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
503
164
    return Status::OK();
504
164
}
505
506
template <typename LocalStateType>
507
1.77M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
0
                                 LocalExchangeSharedState>) {
510
0
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
0
                                        MultiCastSharedState>) {
513
0
        throw Exception(Status::FatalError("should not reach here!"));
514
1.77M
    } else {
515
1.77M
        auto ss = LocalStateType::SharedStateType::create_shared();
516
1.77M
        ss->id = operator_id();
517
1.77M
        for (auto& dest : dests_id()) {
518
1.76M
            ss->related_op_ids.insert(dest);
519
1.76M
        }
520
1.77M
        return ss;
521
1.77M
    }
522
1.77M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
104k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
104k
    } else {
515
104k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
104k
        ss->id = operator_id();
517
104k
        for (auto& dest : dests_id()) {
518
104k
            ss->related_op_ids.insert(dest);
519
104k
        }
520
104k
        return ss;
521
104k
    }
522
104k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
451k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
451k
    } else {
515
451k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
451k
        ss->id = operator_id();
517
451k
        for (auto& dest : dests_id()) {
518
448k
            ss->related_op_ids.insert(dest);
519
448k
        }
520
451k
        return ss;
521
451k
    }
522
451k
}
_ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
86
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
86
    } else {
515
86
        auto ss = LocalStateType::SharedStateType::create_shared();
516
86
        ss->id = operator_id();
517
86
        for (auto& dest : dests_id()) {
518
86
            ss->related_op_ids.insert(dest);
519
86
        }
520
86
        return ss;
521
86
    }
522
86
}
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
3
    } else {
515
3
        auto ss = LocalStateType::SharedStateType::create_shared();
516
3
        ss->id = operator_id();
517
3
        for (auto& dest : dests_id()) {
518
3
            ss->related_op_ids.insert(dest);
519
3
        }
520
3
        return ss;
521
3
    }
522
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
523
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
523
    } else {
515
523
        auto ss = LocalStateType::SharedStateType::create_shared();
516
523
        ss->id = operator_id();
517
523
        for (auto& dest : dests_id()) {
518
523
            ss->related_op_ids.insert(dest);
519
523
        }
520
523
        return ss;
521
523
    }
522
523
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
47.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
47.8k
    } else {
515
47.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
47.8k
        ss->id = operator_id();
517
47.8k
        for (auto& dest : dests_id()) {
518
47.4k
            ss->related_op_ids.insert(dest);
519
47.4k
        }
520
47.8k
        return ss;
521
47.8k
    }
522
47.8k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
507
9.59k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
9.59k
    } else {
515
9.59k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
9.59k
        ss->id = operator_id();
517
9.59k
        for (auto& dest : dests_id()) {
518
9.59k
            ss->related_op_ids.insert(dest);
519
9.59k
        }
520
9.59k
        return ss;
521
9.59k
    }
522
9.59k
}
_ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
5.04k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
5.04k
    } else {
515
5.04k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
5.04k
        ss->id = operator_id();
517
5.04k
        for (auto& dest : dests_id()) {
518
5.04k
            ss->related_op_ids.insert(dest);
519
5.04k
        }
520
5.04k
        return ss;
521
5.04k
    }
522
5.04k
}
_ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
156
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
156
    } else {
515
156
        auto ss = LocalStateType::SharedStateType::create_shared();
516
156
        ss->id = operator_id();
517
156
        for (auto& dest : dests_id()) {
518
156
            ss->related_op_ids.insert(dest);
519
156
        }
520
156
        return ss;
521
156
    }
522
156
}
_ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
4.00k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
4.00k
    } else {
515
4.00k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
4.00k
        ss->id = operator_id();
517
4.00k
        for (auto& dest : dests_id()) {
518
4.00k
            ss->related_op_ids.insert(dest);
519
4.00k
        }
520
4.00k
        return ss;
521
4.00k
    }
522
4.00k
}
_ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
48
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
48
    } else {
515
48
        auto ss = LocalStateType::SharedStateType::create_shared();
516
48
        ss->id = operator_id();
517
48
        for (auto& dest : dests_id()) {
518
48
            ss->related_op_ids.insert(dest);
519
48
        }
520
48
        return ss;
521
48
    }
522
48
}
_ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
704
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
704
    } else {
515
704
        auto ss = LocalStateType::SharedStateType::create_shared();
516
704
        ss->id = operator_id();
517
704
        for (auto& dest : dests_id()) {
518
704
            ss->related_op_ids.insert(dest);
519
704
        }
520
704
        return ss;
521
704
    }
522
704
}
_ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
1.68k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
1.68k
    } else {
515
1.68k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
1.68k
        ss->id = operator_id();
517
1.68k
        for (auto& dest : dests_id()) {
518
1.68k
            ss->related_op_ids.insert(dest);
519
1.68k
        }
520
1.68k
        return ss;
521
1.68k
    }
522
1.68k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
9.00k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
9.00k
    } else {
515
9.00k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
9.00k
        ss->id = operator_id();
517
9.00k
        for (auto& dest : dests_id()) {
518
8.99k
            ss->related_op_ids.insert(dest);
519
8.99k
        }
520
9.00k
        return ss;
521
9.00k
    }
522
9.00k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
128
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
128
    } else {
515
128
        auto ss = LocalStateType::SharedStateType::create_shared();
516
128
        ss->id = operator_id();
517
128
        for (auto& dest : dests_id()) {
518
128
            ss->related_op_ids.insert(dest);
519
128
        }
520
128
        return ss;
521
128
    }
522
128
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
253k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
253k
    } else {
515
253k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
253k
        ss->id = operator_id();
517
253k
        for (auto& dest : dests_id()) {
518
253k
            ss->related_op_ids.insert(dest);
519
253k
        }
520
253k
        return ss;
521
253k
    }
522
253k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
31
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
31
    } else {
515
31
        auto ss = LocalStateType::SharedStateType::create_shared();
516
31
        ss->id = operator_id();
517
31
        for (auto& dest : dests_id()) {
518
31
            ss->related_op_ids.insert(dest);
519
31
        }
520
31
        return ss;
521
31
    }
522
31
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
160k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
160k
    } else {
515
160k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
160k
        ss->id = operator_id();
517
160k
        for (auto& dest : dests_id()) {
518
160k
            ss->related_op_ids.insert(dest);
519
160k
        }
520
160k
        return ss;
521
160k
    }
522
160k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
162
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
162
    } else {
515
162
        auto ss = LocalStateType::SharedStateType::create_shared();
516
162
        ss->id = operator_id();
517
162
        for (auto& dest : dests_id()) {
518
162
            ss->related_op_ids.insert(dest);
519
162
        }
520
162
        return ss;
521
162
    }
522
162
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
705k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
705k
    } else {
515
705k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
705k
        ss->id = operator_id();
517
705k
        for (auto& dest : dests_id()) {
518
700k
            ss->related_op_ids.insert(dest);
519
700k
        }
520
705k
        return ss;
521
705k
    }
522
705k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
10.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
10.8k
    } else {
515
10.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
10.8k
        ss->id = operator_id();
517
10.8k
        for (auto& dest : dests_id()) {
518
10.8k
            ss->related_op_ids.insert(dest);
519
10.8k
        }
520
10.8k
        return ss;
521
10.8k
    }
522
10.8k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
426
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
426
    } else {
515
426
        auto ss = LocalStateType::SharedStateType::create_shared();
516
426
        ss->id = operator_id();
517
426
        for (auto& dest : dests_id()) {
518
426
            ss->related_op_ids.insert(dest);
519
426
        }
520
426
        return ss;
521
426
    }
522
426
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
507
2.58k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
2.58k
    } else {
515
2.58k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
2.58k
        ss->id = operator_id();
517
2.59k
        for (auto& dest : dests_id()) {
518
2.59k
            ss->related_op_ids.insert(dest);
519
2.59k
        }
520
2.58k
        return ss;
521
2.58k
    }
522
2.58k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
507
2.43k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
2.43k
    } else {
515
2.43k
        auto ss = LocalStateType::SharedStateType::create_shared();
516
2.43k
        ss->id = operator_id();
517
2.43k
        for (auto& dest : dests_id()) {
518
2.42k
            ss->related_op_ids.insert(dest);
519
2.42k
        }
520
2.43k
        return ss;
521
2.43k
    }
522
2.43k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
567
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
567
    } else {
515
567
        auto ss = LocalStateType::SharedStateType::create_shared();
516
567
        ss->id = operator_id();
517
567
        for (auto& dest : dests_id()) {
518
564
            ss->related_op_ids.insert(dest);
519
564
        }
520
567
        return ss;
521
567
    }
522
567
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
507
105
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
508
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                 LocalExchangeSharedState>) {
510
        return nullptr;
511
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
512
                                        MultiCastSharedState>) {
513
        throw Exception(Status::FatalError("should not reach here!"));
514
105
    } else {
515
105
        auto ss = LocalStateType::SharedStateType::create_shared();
516
105
        ss->id = operator_id();
517
105
        for (auto& dest : dests_id()) {
518
105
            ss->related_op_ids.insert(dest);
519
105
        }
520
105
        return ss;
521
105
    }
522
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
523
524
template <typename LocalStateType>
525
2.60M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.60M
    auto local_state = LocalStateType::create_unique(state, this);
527
2.60M
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.60M
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.60M
    return Status::OK();
530
2.60M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
75.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
75.5k
    auto local_state = LocalStateType::create_unique(state, this);
527
75.5k
    RETURN_IF_ERROR(local_state->init(state, info));
528
75.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
75.5k
    return Status::OK();
530
75.5k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
320k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
320k
    auto local_state = LocalStateType::create_unique(state, this);
527
320k
    RETURN_IF_ERROR(local_state->init(state, info));
528
320k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
320k
    return Status::OK();
530
320k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
143
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
143
    auto local_state = LocalStateType::create_unique(state, this);
527
143
    RETURN_IF_ERROR(local_state->init(state, info));
528
143
    state->emplace_local_state(operator_id(), std::move(local_state));
529
143
    return Status::OK();
530
143
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
37.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
37.7k
    auto local_state = LocalStateType::create_unique(state, this);
527
37.7k
    RETURN_IF_ERROR(local_state->init(state, info));
528
37.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
37.7k
    return Status::OK();
530
37.7k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
8.95k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
8.95k
    auto local_state = LocalStateType::create_unique(state, this);
527
8.95k
    RETURN_IF_ERROR(local_state->init(state, info));
528
8.95k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
8.95k
    return Status::OK();
530
8.95k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
9.23k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
9.23k
    auto local_state = LocalStateType::create_unique(state, this);
527
9.23k
    RETURN_IF_ERROR(local_state->init(state, info));
528
9.23k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
9.23k
    return Status::OK();
530
9.23k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
22
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
22
    auto local_state = LocalStateType::create_unique(state, this);
527
22
    RETURN_IF_ERROR(local_state->init(state, info));
528
22
    state->emplace_local_state(operator_id(), std::move(local_state));
529
22
    return Status::OK();
530
22
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
244k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
244k
    auto local_state = LocalStateType::create_unique(state, this);
527
244k
    RETURN_IF_ERROR(local_state->init(state, info));
528
244k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
244k
    return Status::OK();
530
244k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
160k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
160k
    auto local_state = LocalStateType::create_unique(state, this);
527
160k
    RETURN_IF_ERROR(local_state->init(state, info));
528
160k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
160k
    return Status::OK();
530
160k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
477
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
477
    auto local_state = LocalStateType::create_unique(state, this);
527
477
    RETURN_IF_ERROR(local_state->init(state, info));
528
477
    state->emplace_local_state(operator_id(), std::move(local_state));
529
477
    return Status::OK();
530
477
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
153
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
153
    auto local_state = LocalStateType::create_unique(state, this);
527
153
    RETURN_IF_ERROR(local_state->init(state, info));
528
153
    state->emplace_local_state(operator_id(), std::move(local_state));
529
153
    return Status::OK();
530
153
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
5.31k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
5.31k
    auto local_state = LocalStateType::create_unique(state, this);
527
5.31k
    RETURN_IF_ERROR(local_state->init(state, info));
528
5.31k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
5.31k
    return Status::OK();
530
5.31k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
402k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
402k
    auto local_state = LocalStateType::create_unique(state, this);
527
402k
    RETURN_IF_ERROR(local_state->init(state, info));
528
402k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
402k
    return Status::OK();
530
402k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
1.31k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
1.31k
    auto local_state = LocalStateType::create_unique(state, this);
527
1.31k
    RETURN_IF_ERROR(local_state->init(state, info));
528
1.31k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
1.31k
    return Status::OK();
530
1.31k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
10.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
10.8k
    auto local_state = LocalStateType::create_unique(state, this);
527
10.8k
    RETURN_IF_ERROR(local_state->init(state, info));
528
10.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
10.8k
    return Status::OK();
530
10.8k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
221
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
221
    auto local_state = LocalStateType::create_unique(state, this);
527
221
    RETURN_IF_ERROR(local_state->init(state, info));
528
221
    state->emplace_local_state(operator_id(), std::move(local_state));
529
221
    return Status::OK();
530
221
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
1.99k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
1.99k
    auto local_state = LocalStateType::create_unique(state, this);
527
1.99k
    RETURN_IF_ERROR(local_state->init(state, info));
528
1.99k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
1.99k
    return Status::OK();
530
1.99k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
55.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
55.8k
    auto local_state = LocalStateType::create_unique(state, this);
527
55.8k
    RETURN_IF_ERROR(local_state->init(state, info));
528
55.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
55.8k
    return Status::OK();
530
55.8k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
9.99k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
9.99k
    auto local_state = LocalStateType::create_unique(state, this);
527
9.99k
    RETURN_IF_ERROR(local_state->init(state, info));
528
9.99k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
9.99k
    return Status::OK();
530
9.99k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
319
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
319
    auto local_state = LocalStateType::create_unique(state, this);
527
319
    RETURN_IF_ERROR(local_state->init(state, info));
528
319
    state->emplace_local_state(operator_id(), std::move(local_state));
529
319
    return Status::OK();
530
319
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
2.61k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.61k
    auto local_state = LocalStateType::create_unique(state, this);
527
2.61k
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.61k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.61k
    return Status::OK();
530
2.61k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
2.47k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.47k
    auto local_state = LocalStateType::create_unique(state, this);
527
2.47k
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.47k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.47k
    return Status::OK();
530
2.47k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
522
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
522
    auto local_state = LocalStateType::create_unique(state, this);
527
522
    RETURN_IF_ERROR(local_state->init(state, info));
528
522
    state->emplace_local_state(operator_id(), std::move(local_state));
529
522
    return Status::OK();
530
522
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
2.22k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.22k
    auto local_state = LocalStateType::create_unique(state, this);
527
2.22k
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.22k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.22k
    return Status::OK();
530
2.22k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
6.95k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
6.95k
    auto local_state = LocalStateType::create_unique(state, this);
527
6.95k
    RETURN_IF_ERROR(local_state->init(state, info));
528
6.95k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
6.95k
    return Status::OK();
530
6.95k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
780k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
780k
    auto local_state = LocalStateType::create_unique(state, this);
527
780k
    RETURN_IF_ERROR(local_state->init(state, info));
528
780k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
780k
    return Status::OK();
530
780k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
14
    auto local_state = LocalStateType::create_unique(state, this);
527
14
    RETURN_IF_ERROR(local_state->init(state, info));
528
14
    state->emplace_local_state(operator_id(), std::move(local_state));
529
14
    return Status::OK();
530
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
164
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
164
    auto local_state = LocalStateType::create_unique(state, this);
527
164
    RETURN_IF_ERROR(local_state->init(state, info));
528
164
    state->emplace_local_state(operator_id(), std::move(local_state));
529
164
    return Status::OK();
530
164
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
2.18k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.18k
    auto local_state = LocalStateType::create_unique(state, this);
527
2.18k
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.18k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.18k
    return Status::OK();
530
2.18k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
1.73k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
1.73k
    auto local_state = LocalStateType::create_unique(state, this);
527
1.73k
    RETURN_IF_ERROR(local_state->init(state, info));
528
1.73k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
1.73k
    return Status::OK();
530
1.73k
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
2.86k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
2.86k
    auto local_state = LocalStateType::create_unique(state, this);
527
2.86k
    RETURN_IF_ERROR(local_state->init(state, info));
528
2.86k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
2.86k
    return Status::OK();
530
2.86k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
11.9k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
11.9k
    auto local_state = LocalStateType::create_unique(state, this);
527
11.9k
    RETURN_IF_ERROR(local_state->init(state, info));
528
11.9k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
11.9k
    return Status::OK();
530
11.9k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
525
446k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
526
446k
    auto local_state = LocalStateType::create_unique(state, this);
527
446k
    RETURN_IF_ERROR(local_state->init(state, info));
528
446k
    state->emplace_local_state(operator_id(), std::move(local_state));
529
446k
    return Status::OK();
530
446k
}
531
532
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
533
                                                         RuntimeState* state)
534
2.11M
        : _parent(parent), _state(state) {}
535
536
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
537
2.59M
        : _num_rows_returned(0),
538
2.59M
          _rows_returned_counter(nullptr),
539
2.59M
          _parent(parent),
540
2.59M
          _state(state),
541
2.59M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
542
543
template <typename SharedStateArg>
544
2.60M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
2.60M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
2.60M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
2.60M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
2.60M
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
2.60M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
2.60M
    _operator_profile->add_child(_common_profile.get(), true);
553
2.60M
    _operator_profile->add_child(_custom_profile.get(), true);
554
2.60M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
2.60M
    if constexpr (!is_fake_shared) {
556
1.36M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
798k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
798k
                                    .first.get()
559
798k
                                    ->template cast<SharedStateArg>();
560
561
798k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
798k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
798k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
798k
        } else if (info.shared_state) {
565
503k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
0
                DCHECK(false);
567
0
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
503k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
503k
            _dependency = _shared_state->create_source_dependency(
572
503k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
503k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
503k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
503k
        } else {
576
64.2k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
4.95k
                DCHECK(false);
578
4.95k
            }
579
64.2k
        }
580
1.36M
    }
581
582
2.60M
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
2.60M
    _rows_returned_counter =
587
2.60M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
2.60M
    _blocks_returned_counter =
589
2.60M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
2.60M
    _output_block_bytes_counter =
591
2.60M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
2.60M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
2.60M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
2.60M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
2.60M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
2.60M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
2.60M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
2.60M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
2.60M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
2.60M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
2.60M
    _memory_used_counter =
602
2.60M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
2.60M
    _common_profile->add_info_string("IsColocate",
604
2.60M
                                     std::to_string(_parent->is_colocated_operator()));
605
2.60M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
2.60M
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
2.60M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
2.60M
    return Status::OK();
609
2.60M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
75.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
75.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
75.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
75.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
75.5k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
75.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
75.5k
    _operator_profile->add_child(_common_profile.get(), true);
553
75.5k
    _operator_profile->add_child(_custom_profile.get(), true);
554
75.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
75.5k
    if constexpr (!is_fake_shared) {
556
75.5k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
18.9k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
18.9k
                                    .first.get()
559
18.9k
                                    ->template cast<SharedStateArg>();
560
561
18.9k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
18.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
18.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
56.6k
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
56.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
56.0k
            _dependency = _shared_state->create_source_dependency(
572
56.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
56.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
56.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
56.0k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
533
        }
580
75.5k
    }
581
582
75.5k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
75.5k
    _rows_returned_counter =
587
75.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
75.5k
    _blocks_returned_counter =
589
75.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
75.5k
    _output_block_bytes_counter =
591
75.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
75.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
75.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
75.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
75.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
75.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
75.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
75.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
75.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
75.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
75.5k
    _memory_used_counter =
602
75.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
75.5k
    _common_profile->add_info_string("IsColocate",
604
75.5k
                                     std::to_string(_parent->is_colocated_operator()));
605
75.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
75.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
75.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
75.5k
    return Status::OK();
609
75.5k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
1
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
1
    _operator_profile->add_child(_common_profile.get(), true);
553
1
    _operator_profile->add_child(_custom_profile.get(), true);
554
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
1
    if constexpr (!is_fake_shared) {
556
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
1
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
1
            _dependency = _shared_state->create_source_dependency(
572
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
1
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
1
    }
581
582
1
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
1
    _rows_returned_counter =
587
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
1
    _blocks_returned_counter =
589
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
1
    _output_block_bytes_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
1
    _memory_used_counter =
602
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
1
    _common_profile->add_info_string("IsColocate",
604
1
                                     std::to_string(_parent->is_colocated_operator()));
605
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
1
    return Status::OK();
609
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
253k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
253k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
253k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
253k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
253k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
253k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
253k
    _operator_profile->add_child(_common_profile.get(), true);
553
253k
    _operator_profile->add_child(_custom_profile.get(), true);
554
253k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
253k
    if constexpr (!is_fake_shared) {
556
253k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
253k
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
249k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
249k
            _dependency = _shared_state->create_source_dependency(
572
249k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
249k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
249k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
249k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
4.26k
        }
580
253k
    }
581
582
253k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
253k
    _rows_returned_counter =
587
253k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
253k
    _blocks_returned_counter =
589
253k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
253k
    _output_block_bytes_counter =
591
253k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
253k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
253k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
253k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
253k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
253k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
253k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
253k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
253k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
253k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
253k
    _memory_used_counter =
602
253k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
253k
    _common_profile->add_info_string("IsColocate",
604
253k
                                     std::to_string(_parent->is_colocated_operator()));
605
253k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
253k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
253k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
253k
    return Status::OK();
609
253k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
22
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
22
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
22
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
22
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
22
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
22
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
22
    _operator_profile->add_child(_common_profile.get(), true);
553
22
    _operator_profile->add_child(_custom_profile.get(), true);
554
22
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
22
    if constexpr (!is_fake_shared) {
556
22
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
22
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
22
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
22
            _dependency = _shared_state->create_source_dependency(
572
22
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
22
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
22
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
22
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
22
    }
581
582
22
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
22
    _rows_returned_counter =
587
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
22
    _blocks_returned_counter =
589
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
22
    _output_block_bytes_counter =
591
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
22
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
22
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
22
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
22
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
22
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
22
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
22
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
22
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
22
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
22
    _memory_used_counter =
602
22
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
22
    _common_profile->add_info_string("IsColocate",
604
22
                                     std::to_string(_parent->is_colocated_operator()));
605
22
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
22
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
22
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
22
    return Status::OK();
609
22
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
10.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
10.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
10.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
10.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
10.8k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
10.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
10.8k
    _operator_profile->add_child(_common_profile.get(), true);
553
10.8k
    _operator_profile->add_child(_custom_profile.get(), true);
554
10.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
10.8k
    if constexpr (!is_fake_shared) {
556
10.8k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
10.8k
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
10.7k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
10.7k
            _dependency = _shared_state->create_source_dependency(
572
10.7k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
10.7k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
10.7k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
10.7k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
60
        }
580
10.8k
    }
581
582
10.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
10.8k
    _rows_returned_counter =
587
10.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
10.8k
    _blocks_returned_counter =
589
10.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
10.8k
    _output_block_bytes_counter =
591
10.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
10.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
10.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
10.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
10.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
10.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
10.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
10.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
10.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
10.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
10.8k
    _memory_used_counter =
602
10.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
10.8k
    _common_profile->add_info_string("IsColocate",
604
10.8k
                                     std::to_string(_parent->is_colocated_operator()));
605
10.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
10.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
10.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
10.8k
    return Status::OK();
609
10.8k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
9.01k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
9.01k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
9.01k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
9.01k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
9.01k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
9.01k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
9.01k
    _operator_profile->add_child(_common_profile.get(), true);
553
9.01k
    _operator_profile->add_child(_custom_profile.get(), true);
554
9.01k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
9.01k
    if constexpr (!is_fake_shared) {
556
9.01k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
9.01k
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
8.90k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
8.90k
            _dependency = _shared_state->create_source_dependency(
572
8.90k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
8.90k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
8.90k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
8.90k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
112
        }
580
9.01k
    }
581
582
9.01k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
9.01k
    _rows_returned_counter =
587
9.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
9.01k
    _blocks_returned_counter =
589
9.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
9.01k
    _output_block_bytes_counter =
591
9.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
9.01k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
9.01k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
9.01k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
9.01k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
9.01k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
9.01k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
9.01k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
9.01k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
9.01k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
9.01k
    _memory_used_counter =
602
9.01k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
9.01k
    _common_profile->add_info_string("IsColocate",
604
9.01k
                                     std::to_string(_parent->is_colocated_operator()));
605
9.01k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
9.01k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
9.01k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
9.01k
    return Status::OK();
609
9.01k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
160k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
160k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
160k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
160k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
160k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
160k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
160k
    _operator_profile->add_child(_common_profile.get(), true);
553
160k
    _operator_profile->add_child(_custom_profile.get(), true);
554
160k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
160k
    if constexpr (!is_fake_shared) {
556
160k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
160k
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
159k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
159k
            _dependency = _shared_state->create_source_dependency(
572
159k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
159k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
159k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
159k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
1.07k
        }
580
160k
    }
581
582
160k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
160k
    _rows_returned_counter =
587
160k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
160k
    _blocks_returned_counter =
589
160k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
160k
    _output_block_bytes_counter =
591
160k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
160k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
160k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
160k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
160k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
160k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
160k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
160k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
160k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
160k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
160k
    _memory_used_counter =
602
160k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
160k
    _common_profile->add_info_string("IsColocate",
604
160k
                                     std::to_string(_parent->is_colocated_operator()));
605
160k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
160k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
160k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
160k
    return Status::OK();
609
160k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
481
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
481
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
481
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
481
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
481
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
481
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
481
    _operator_profile->add_child(_common_profile.get(), true);
553
481
    _operator_profile->add_child(_custom_profile.get(), true);
554
481
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
481
    if constexpr (!is_fake_shared) {
556
481
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
479
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
479
                                    .first.get()
559
479
                                    ->template cast<SharedStateArg>();
560
561
479
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
479
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
479
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
479
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
0
            _dependency = _shared_state->create_source_dependency(
572
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
2
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
2
        }
580
481
    }
581
582
481
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
481
    _rows_returned_counter =
587
481
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
481
    _blocks_returned_counter =
589
481
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
481
    _output_block_bytes_counter =
591
481
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
481
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
481
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
481
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
481
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
481
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
481
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
481
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
481
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
481
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
481
    _memory_used_counter =
602
481
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
481
    _common_profile->add_info_string("IsColocate",
604
481
                                     std::to_string(_parent->is_colocated_operator()));
605
481
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
481
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
481
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
481
    return Status::OK();
609
481
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
153
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
153
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
153
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
153
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
153
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
153
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
153
    _operator_profile->add_child(_common_profile.get(), true);
553
153
    _operator_profile->add_child(_custom_profile.get(), true);
554
153
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
153
    if constexpr (!is_fake_shared) {
556
153
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
153
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
153
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
153
            _dependency = _shared_state->create_source_dependency(
572
153
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
153
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
153
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
153
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
153
    }
581
582
153
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
153
    _rows_returned_counter =
587
153
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
153
    _blocks_returned_counter =
589
153
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
153
    _output_block_bytes_counter =
591
153
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
153
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
153
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
153
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
153
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
153
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
153
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
153
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
153
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
153
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
153
    _memory_used_counter =
602
153
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
153
    _common_profile->add_info_string("IsColocate",
604
153
                                     std::to_string(_parent->is_colocated_operator()));
605
153
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
153
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
153
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
153
    return Status::OK();
609
153
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
1.24M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
1.24M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
1.24M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
1.24M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
1.24M
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
1.24M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
1.24M
    _operator_profile->add_child(_common_profile.get(), true);
553
1.24M
    _operator_profile->add_child(_custom_profile.get(), true);
554
1.24M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
    if constexpr (!is_fake_shared) {
556
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
                                    .first.get()
559
                                    ->template cast<SharedStateArg>();
560
561
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
            _dependency = _shared_state->create_source_dependency(
572
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
        }
580
    }
581
582
1.24M
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
1.24M
    _rows_returned_counter =
587
1.24M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
1.24M
    _blocks_returned_counter =
589
1.24M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
1.24M
    _output_block_bytes_counter =
591
1.24M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
1.24M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
1.24M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
1.24M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
1.24M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.24M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
1.24M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
1.24M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
1.24M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
1.24M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
1.24M
    _memory_used_counter =
602
1.24M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
1.24M
    _common_profile->add_info_string("IsColocate",
604
1.24M
                                     std::to_string(_parent->is_colocated_operator()));
605
1.24M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
1.24M
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
1.24M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
1.24M
    return Status::OK();
609
1.24M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
55.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
55.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
55.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
55.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
55.7k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
55.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
55.7k
    _operator_profile->add_child(_common_profile.get(), true);
553
55.7k
    _operator_profile->add_child(_custom_profile.get(), true);
554
55.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
55.7k
    if constexpr (!is_fake_shared) {
556
55.7k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
55.7k
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
2.53k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
2.53k
            _dependency = _shared_state->create_source_dependency(
572
2.53k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
2.53k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
2.53k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
53.2k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
53.2k
        }
580
55.7k
    }
581
582
55.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
55.7k
    _rows_returned_counter =
587
55.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
55.7k
    _blocks_returned_counter =
589
55.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
55.7k
    _output_block_bytes_counter =
591
55.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
55.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
55.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
55.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
55.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
55.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
55.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
55.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
55.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
55.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
55.7k
    _memory_used_counter =
602
55.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
55.7k
    _common_profile->add_info_string("IsColocate",
604
55.7k
                                     std::to_string(_parent->is_colocated_operator()));
605
55.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
55.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
55.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
55.7k
    return Status::OK();
609
55.7k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
26
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
26
    _operator_profile->add_child(_common_profile.get(), true);
553
26
    _operator_profile->add_child(_custom_profile.get(), true);
554
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
26
    if constexpr (!is_fake_shared) {
556
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
26
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
26
            _dependency = _shared_state->create_source_dependency(
572
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
26
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
26
    }
581
582
26
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
26
    _rows_returned_counter =
587
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
26
    _blocks_returned_counter =
589
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
26
    _output_block_bytes_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
26
    _memory_used_counter =
602
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
26
    _common_profile->add_info_string("IsColocate",
604
26
                                     std::to_string(_parent->is_colocated_operator()));
605
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
26
    return Status::OK();
609
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
10.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
10.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
10.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
10.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
10.0k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
10.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
10.0k
    _operator_profile->add_child(_common_profile.get(), true);
553
10.0k
    _operator_profile->add_child(_custom_profile.get(), true);
554
10.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
10.0k
    if constexpr (!is_fake_shared) {
556
10.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
10.0k
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
9.98k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
9.98k
            _dependency = _shared_state->create_source_dependency(
572
9.98k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
9.98k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
9.98k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
9.98k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
16
        }
580
10.0k
    }
581
582
10.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
10.0k
    _rows_returned_counter =
587
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
10.0k
    _blocks_returned_counter =
589
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
10.0k
    _output_block_bytes_counter =
591
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
10.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
10.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
10.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
10.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
10.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
10.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
10.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
10.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
10.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
10.0k
    _memory_used_counter =
602
10.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
10.0k
    _common_profile->add_info_string("IsColocate",
604
10.0k
                                     std::to_string(_parent->is_colocated_operator()));
605
10.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
10.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
10.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
10.0k
    return Status::OK();
609
10.0k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
423
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
423
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
423
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
423
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
423
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
423
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
423
    _operator_profile->add_child(_common_profile.get(), true);
553
423
    _operator_profile->add_child(_custom_profile.get(), true);
554
423
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
423
    if constexpr (!is_fake_shared) {
556
423
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
423
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
423
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
423
            _dependency = _shared_state->create_source_dependency(
572
423
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
423
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
423
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
423
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
423
    }
581
582
424
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
423
    _rows_returned_counter =
587
423
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
423
    _blocks_returned_counter =
589
423
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
423
    _output_block_bytes_counter =
591
423
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
423
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
423
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
423
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
423
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
423
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
423
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
423
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
423
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
423
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
423
    _memory_used_counter =
602
423
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
423
    _common_profile->add_info_string("IsColocate",
604
423
                                     std::to_string(_parent->is_colocated_operator()));
605
423
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
423
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
423
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
423
    return Status::OK();
609
423
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
5.11k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
5.11k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
5.11k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
5.11k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
5.11k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
5.11k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
5.11k
    _operator_profile->add_child(_common_profile.get(), true);
553
5.11k
    _operator_profile->add_child(_custom_profile.get(), true);
554
5.11k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
5.11k
    if constexpr (!is_fake_shared) {
556
5.11k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
5.11k
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
5.07k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
5.07k
            _dependency = _shared_state->create_source_dependency(
572
5.07k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
5.07k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
5.07k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
5.07k
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
40
        }
580
5.11k
    }
581
582
5.11k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
5.11k
    _rows_returned_counter =
587
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
5.11k
    _blocks_returned_counter =
589
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
5.11k
    _output_block_bytes_counter =
591
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
5.11k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
5.11k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
5.11k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
5.11k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.11k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
5.11k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
5.11k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
5.11k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
5.11k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
5.11k
    _memory_used_counter =
602
5.11k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
5.11k
    _common_profile->add_info_string("IsColocate",
604
5.11k
                                     std::to_string(_parent->is_colocated_operator()));
605
5.11k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
5.11k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
5.11k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
5.11k
    return Status::OK();
609
5.11k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
783k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
783k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
783k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
783k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
783k
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
783k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
783k
    _operator_profile->add_child(_common_profile.get(), true);
553
783k
    _operator_profile->add_child(_custom_profile.get(), true);
554
783k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
783k
    if constexpr (!is_fake_shared) {
556
783k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
778k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
778k
                                    .first.get()
559
778k
                                    ->template cast<SharedStateArg>();
560
561
778k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
778k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
778k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
778k
        } else if (info.shared_state) {
565
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
0
                DCHECK(false);
567
0
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
0
            _dependency = _shared_state->create_source_dependency(
572
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
4.95k
        } else {
576
4.95k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
4.95k
                DCHECK(false);
578
4.95k
            }
579
4.95k
        }
580
783k
    }
581
582
783k
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
783k
    _rows_returned_counter =
587
783k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
783k
    _blocks_returned_counter =
589
783k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
783k
    _output_block_bytes_counter =
591
783k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
783k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
783k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
783k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
783k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
783k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
783k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
783k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
783k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
783k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
783k
    _memory_used_counter =
602
783k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
783k
    _common_profile->add_info_string("IsColocate",
604
783k
                                     std::to_string(_parent->is_colocated_operator()));
605
783k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
783k
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
783k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
783k
    return Status::OK();
609
783k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
544
164
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
545
164
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
546
164
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
547
164
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
548
164
    _operator_profile->set_metadata(_parent->node_id());
549
    // indent is false so that source operator will have same
550
    // indentation_level with its parent operator.
551
164
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
552
164
    _operator_profile->add_child(_common_profile.get(), true);
553
164
    _operator_profile->add_child(_custom_profile.get(), true);
554
164
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
555
164
    if constexpr (!is_fake_shared) {
556
164
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
557
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
558
0
                                    .first.get()
559
0
                                    ->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
562
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
563
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
564
164
        } else if (info.shared_state) {
565
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
566
                DCHECK(false);
567
            }
568
            // For UnionSourceOperator without children, there is no shared state.
569
164
            _shared_state = info.shared_state->template cast<SharedStateArg>();
570
571
164
            _dependency = _shared_state->create_source_dependency(
572
164
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
573
164
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
574
164
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
575
164
        } else {
576
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
577
                DCHECK(false);
578
            }
579
0
        }
580
164
    }
581
582
164
    if (must_set_shared_state() && _shared_state == nullptr) {
583
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
584
0
    }
585
586
164
    _rows_returned_counter =
587
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
588
164
    _blocks_returned_counter =
589
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
590
164
    _output_block_bytes_counter =
591
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
592
164
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
593
164
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
594
164
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
595
164
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
164
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
597
164
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
598
164
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
599
164
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
600
164
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
601
164
    _memory_used_counter =
602
164
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
603
164
    _common_profile->add_info_string("IsColocate",
604
164
                                     std::to_string(_parent->is_colocated_operator()));
605
164
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
606
164
    _common_profile->add_info_string("FollowedByShuffledOperator",
607
164
                                     std::to_string(_parent->followed_by_shuffled_operator()));
608
164
    return Status::OK();
609
164
}
610
611
template <typename SharedStateArg>
612
2.61M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
2.61M
    _conjuncts.resize(_parent->_conjuncts.size());
614
2.61M
    _projections.resize(_parent->_projections.size());
615
3.15M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
534k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
534k
    }
618
5.47M
    for (size_t i = 0; i < _projections.size(); i++) {
619
2.85M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
2.85M
    }
621
2.61M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
2.63M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
16.5k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
120k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
104k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
104k
                    state, _intermediate_projections[i][j]));
627
104k
        }
628
16.5k
    }
629
2.61M
    return Status::OK();
630
2.61M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
75.7k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
75.7k
    _conjuncts.resize(_parent->_conjuncts.size());
614
75.7k
    _projections.resize(_parent->_projections.size());
615
76.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
871
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
871
    }
618
383k
    for (size_t i = 0; i < _projections.size(); i++) {
619
307k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
307k
    }
621
75.7k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
78.8k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
3.13k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
41.5k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
38.3k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
38.3k
                    state, _intermediate_projections[i][j]));
627
38.3k
        }
628
3.13k
    }
629
75.7k
    return Status::OK();
630
75.7k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
3
    _conjuncts.resize(_parent->_conjuncts.size());
614
3
    _projections.resize(_parent->_projections.size());
615
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
3
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
3
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
3
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
3
    return Status::OK();
630
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
254k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
254k
    _conjuncts.resize(_parent->_conjuncts.size());
614
254k
    _projections.resize(_parent->_projections.size());
615
254k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
254k
    for (size_t i = 0; i < _projections.size(); i++) {
619
361
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
361
    }
621
254k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
254k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
254k
    return Status::OK();
630
254k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
22
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
22
    _conjuncts.resize(_parent->_conjuncts.size());
614
22
    _projections.resize(_parent->_projections.size());
615
22
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
22
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
22
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
22
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
22
    return Status::OK();
630
22
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
10.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
10.8k
    _conjuncts.resize(_parent->_conjuncts.size());
614
10.8k
    _projections.resize(_parent->_projections.size());
615
10.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
101
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
101
    }
618
69.7k
    for (size_t i = 0; i < _projections.size(); i++) {
619
58.8k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
58.8k
    }
621
10.8k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
11.0k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
146
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
894
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
748
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
748
                    state, _intermediate_projections[i][j]));
627
748
        }
628
146
    }
629
10.8k
    return Status::OK();
630
10.8k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
9.02k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
9.02k
    _conjuncts.resize(_parent->_conjuncts.size());
614
9.02k
    _projections.resize(_parent->_projections.size());
615
9.95k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
925
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
925
    }
618
24.8k
    for (size_t i = 0; i < _projections.size(); i++) {
619
15.7k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
15.7k
    }
621
9.02k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
9.11k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
91
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
690
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
599
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
599
                    state, _intermediate_projections[i][j]));
627
599
        }
628
91
    }
629
9.02k
    return Status::OK();
630
9.02k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
160k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
160k
    _conjuncts.resize(_parent->_conjuncts.size());
614
160k
    _projections.resize(_parent->_projections.size());
615
164k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
3.91k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
3.91k
    }
618
427k
    for (size_t i = 0; i < _projections.size(); i++) {
619
266k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
266k
    }
621
160k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
161k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
265
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
1.94k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
1.68k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
1.68k
                    state, _intermediate_projections[i][j]));
627
1.68k
        }
628
265
    }
629
160k
    return Status::OK();
630
160k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
484
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
484
    _conjuncts.resize(_parent->_conjuncts.size());
614
484
    _projections.resize(_parent->_projections.size());
615
489
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
5
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
5
    }
618
1.70k
    for (size_t i = 0; i < _projections.size(); i++) {
619
1.21k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
1.21k
    }
621
484
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
484
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
484
    return Status::OK();
630
484
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
157
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
157
    _conjuncts.resize(_parent->_conjuncts.size());
614
157
    _projections.resize(_parent->_projections.size());
615
157
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
437
    for (size_t i = 0; i < _projections.size(); i++) {
619
280
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
280
    }
621
157
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
157
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
157
    return Status::OK();
630
157
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
1.24M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
1.24M
    _conjuncts.resize(_parent->_conjuncts.size());
614
1.24M
    _projections.resize(_parent->_projections.size());
615
1.77M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
524k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
524k
    }
618
3.35M
    for (size_t i = 0; i < _projections.size(); i++) {
619
2.11M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
2.11M
    }
621
1.24M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
1.26M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
12.8k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
75.6k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
62.7k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
62.7k
                    state, _intermediate_projections[i][j]));
627
62.7k
        }
628
12.8k
    }
629
1.24M
    return Status::OK();
630
1.24M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
56.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
56.0k
    _conjuncts.resize(_parent->_conjuncts.size());
614
56.0k
    _projections.resize(_parent->_projections.size());
615
56.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
152k
    for (size_t i = 0; i < _projections.size(); i++) {
619
96.4k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
96.4k
    }
621
56.0k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
56.0k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
56.0k
    return Status::OK();
630
56.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
25
    _conjuncts.resize(_parent->_conjuncts.size());
614
25
    _projections.resize(_parent->_projections.size());
615
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
25
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
25
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
25
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
25
    return Status::OK();
630
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
9.97k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
9.97k
    _conjuncts.resize(_parent->_conjuncts.size());
614
9.97k
    _projections.resize(_parent->_projections.size());
615
13.7k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
3.75k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
3.75k
    }
618
9.97k
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
9.97k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
9.97k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
9.97k
    return Status::OK();
630
9.97k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
428
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
428
    _conjuncts.resize(_parent->_conjuncts.size());
614
428
    _projections.resize(_parent->_projections.size());
615
428
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
428
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
428
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
428
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
428
    return Status::OK();
630
428
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
5.11k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
5.11k
    _conjuncts.resize(_parent->_conjuncts.size());
614
5.11k
    _projections.resize(_parent->_projections.size());
615
5.11k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
5.28k
    for (size_t i = 0; i < _projections.size(); i++) {
619
168
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
168
    }
621
5.11k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
5.11k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
5.11k
    return Status::OK();
630
5.11k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
785k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
785k
    _conjuncts.resize(_parent->_conjuncts.size());
614
785k
    _projections.resize(_parent->_projections.size());
615
785k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
0
    }
618
785k
    for (size_t i = 0; i < _projections.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
0
    }
621
785k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
785k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
0
                    state, _intermediate_projections[i][j]));
627
0
        }
628
0
    }
629
785k
    return Status::OK();
630
785k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
612
164
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
613
164
    _conjuncts.resize(_parent->_conjuncts.size());
614
164
    _projections.resize(_parent->_projections.size());
615
171
    for (size_t i = 0; i < _conjuncts.size(); i++) {
616
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
617
7
    }
618
483
    for (size_t i = 0; i < _projections.size(); i++) {
619
319
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
620
319
    }
621
164
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
622
167
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
623
3
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
624
11
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
625
8
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
626
8
                    state, _intermediate_projections[i][j]));
627
8
        }
628
3
    }
629
164
    return Status::OK();
630
164
}
631
632
template <typename SharedStateArg>
633
8.00k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
8.00k
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
8.00k
    _terminated = true;
638
8.00k
    return Status::OK();
639
8.00k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
348
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
348
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
348
    _terminated = true;
638
348
    return Status::OK();
639
348
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
32
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
32
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
32
    _terminated = true;
638
32
    return Status::OK();
639
32
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
77
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
77
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
77
    _terminated = true;
638
77
    return Status::OK();
639
77
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
9
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
9
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
9
    _terminated = true;
638
9
    return Status::OK();
639
9
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
85
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
85
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
85
    _terminated = true;
638
85
    return Status::OK();
639
85
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
6.74k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
6.74k
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
6.74k
    _terminated = true;
638
6.74k
    return Status::OK();
639
6.74k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
4
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
4
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
4
    _terminated = true;
638
4
    return Status::OK();
639
4
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
7
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
7
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
7
    _terminated = true;
638
7
    return Status::OK();
639
7
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
1
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
1
    _terminated = true;
638
1
    return Status::OK();
639
1
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
673
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
673
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
673
    _terminated = true;
638
673
    return Status::OK();
639
673
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
633
17
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
634
17
    if (_terminated) {
635
0
        return Status::OK();
636
0
    }
637
17
    _terminated = true;
638
17
    return Status::OK();
639
17
}
640
641
template <typename SharedStateArg>
642
2.90M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
2.90M
    if (_closed) {
644
287k
        return Status::OK();
645
287k
    }
646
2.61M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
1.36M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
1.36M
    }
649
2.61M
    _closed = true;
650
2.61M
    return Status::OK();
651
2.90M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
75.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
75.6k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
75.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
75.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
75.6k
    }
649
75.6k
    _closed = true;
650
75.6k
    return Status::OK();
651
75.6k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
4
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
4
    }
649
4
    _closed = true;
650
4
    return Status::OK();
651
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
503k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
503k
    if (_closed) {
644
252k
        return Status::OK();
645
252k
    }
646
251k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
251k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
251k
    }
649
251k
    _closed = true;
650
251k
    return Status::OK();
651
503k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
22
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
22
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
22
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
22
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
22
    }
649
22
    _closed = true;
650
22
    return Status::OK();
651
22
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
10.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
10.8k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
10.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
10.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
10.8k
    }
649
10.8k
    _closed = true;
650
10.8k
    return Status::OK();
651
10.8k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
18.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
18.1k
    if (_closed) {
644
9.10k
        return Status::OK();
645
9.10k
    }
646
9.00k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
9.00k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
9.00k
    }
649
9.00k
    _closed = true;
650
9.00k
    return Status::OK();
651
18.1k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
160k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
160k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
160k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
160k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
160k
    }
649
160k
    _closed = true;
650
160k
    return Status::OK();
651
160k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
481
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
481
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
481
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
481
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
481
    }
649
481
    _closed = true;
650
481
    return Status::OK();
651
481
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
152
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
152
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
152
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
152
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
152
    }
649
152
    _closed = true;
650
152
    return Status::OK();
651
152
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
1.26M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
1.26M
    if (_closed) {
644
20.1k
        return Status::OK();
645
20.1k
    }
646
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
    }
649
1.24M
    _closed = true;
650
1.24M
    return Status::OK();
651
1.26M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
56.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
56.0k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
56.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
56.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
56.0k
    }
649
56.0k
    _closed = true;
650
56.0k
    return Status::OK();
651
56.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
28
    if (_closed) {
644
14
        return Status::OK();
645
14
    }
646
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
14
    }
649
14
    _closed = true;
650
14
    return Status::OK();
651
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
9.97k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
9.97k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
9.97k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
9.97k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
9.97k
    }
649
9.97k
    _closed = true;
650
9.97k
    return Status::OK();
651
9.97k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
651
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
651
    if (_closed) {
644
325
        return Status::OK();
645
325
    }
646
326
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
326
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
326
    }
649
326
    _closed = true;
650
326
    return Status::OK();
651
651
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
10.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
10.4k
    if (_closed) {
644
5.34k
        return Status::OK();
645
5.34k
    }
646
5.11k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
5.11k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
5.11k
    }
649
5.11k
    _closed = true;
650
5.11k
    return Status::OK();
651
10.4k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
787k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
787k
    if (_closed) {
644
0
        return Status::OK();
645
0
    }
646
787k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
787k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
787k
    }
649
787k
    _closed = true;
650
787k
    return Status::OK();
651
787k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
642
330
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
643
330
    if (_closed) {
644
175
        return Status::OK();
645
175
    }
646
155
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
647
155
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
648
155
    }
649
155
    _closed = true;
650
155
    return Status::OK();
651
330
}
652
653
template <typename SharedState>
654
2.12M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
2.12M
    _operator_profile =
657
2.12M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
2.12M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
2.12M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
2.12M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
2.12M
    _operator_profile->add_child(_common_profile, true);
666
2.12M
    _operator_profile->add_child(_custom_profile, true);
667
668
2.12M
    _operator_profile->set_metadata(_parent->node_id());
669
2.12M
    _wait_for_finish_dependency_timer =
670
2.12M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
2.12M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
2.12M
    if constexpr (!is_fake_shared) {
673
1.41M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
1.41M
            info.shared_state_map.end()) {
675
331k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
312k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
312k
            }
678
331k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
331k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
331k
                                                  ? 0
681
331k
                                                  : info.task_idx]
682
331k
                                  .get();
683
331k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
1.08M
        } else {
685
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
18.4E
                DCHECK(false);
687
18.4E
            }
688
1.08M
            _shared_state = info.shared_state->template cast<SharedState>();
689
1.08M
            _dependency = _shared_state->create_sink_dependency(
690
1.08M
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
1.08M
        }
692
1.41M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
1.41M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
1.41M
    }
695
696
2.12M
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
2.12M
    _rows_input_counter =
701
2.12M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
2.12M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
2.12M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
2.12M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
2.12M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
2.12M
    _memory_used_counter =
707
2.12M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
2.12M
    _common_profile->add_info_string("IsColocate",
709
2.12M
                                     std::to_string(_parent->is_colocated_operator()));
710
2.12M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
2.12M
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
2.12M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
2.12M
    return Status::OK();
714
2.12M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
123k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
123k
    _operator_profile =
657
123k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
123k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
123k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
123k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
123k
    _operator_profile->add_child(_common_profile, true);
666
123k
    _operator_profile->add_child(_custom_profile, true);
667
668
123k
    _operator_profile->set_metadata(_parent->node_id());
669
123k
    _wait_for_finish_dependency_timer =
670
123k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
123k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
123k
    if constexpr (!is_fake_shared) {
673
123k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
123k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
19.1k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
19.1k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
19.1k
                                                  ? 0
681
19.1k
                                                  : info.task_idx]
682
19.1k
                                  .get();
683
19.1k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
104k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
104k
            _shared_state = info.shared_state->template cast<SharedState>();
689
104k
            _dependency = _shared_state->create_sink_dependency(
690
104k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
104k
        }
692
123k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
123k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
123k
    }
695
696
123k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
123k
    _rows_input_counter =
701
123k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
123k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
123k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
123k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
123k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
123k
    _memory_used_counter =
707
123k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
123k
    _common_profile->add_info_string("IsColocate",
709
123k
                                     std::to_string(_parent->is_colocated_operator()));
710
123k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
123k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
123k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
123k
    return Status::OK();
714
123k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
2
    _operator_profile =
657
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
2
    _operator_profile->add_child(_common_profile, true);
666
2
    _operator_profile->add_child(_custom_profile, true);
667
668
2
    _operator_profile->set_metadata(_parent->node_id());
669
2
    _wait_for_finish_dependency_timer =
670
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
2
    if constexpr (!is_fake_shared) {
673
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
2
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
2
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
2
            _shared_state = info.shared_state->template cast<SharedState>();
689
2
            _dependency = _shared_state->create_sink_dependency(
690
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
2
        }
692
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
2
    }
695
696
2
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
2
    _rows_input_counter =
701
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
2
    _memory_used_counter =
707
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
2
    _common_profile->add_info_string("IsColocate",
709
2
                                     std::to_string(_parent->is_colocated_operator()));
710
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
2
    return Status::OK();
714
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
253k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
253k
    _operator_profile =
657
253k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
253k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
253k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
253k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
253k
    _operator_profile->add_child(_common_profile, true);
666
253k
    _operator_profile->add_child(_custom_profile, true);
667
668
253k
    _operator_profile->set_metadata(_parent->node_id());
669
253k
    _wait_for_finish_dependency_timer =
670
253k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
253k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
253k
    if constexpr (!is_fake_shared) {
673
253k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
253k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
253k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
253k
            _shared_state = info.shared_state->template cast<SharedState>();
689
253k
            _dependency = _shared_state->create_sink_dependency(
690
253k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
253k
        }
692
253k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
253k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
253k
    }
695
696
253k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
253k
    _rows_input_counter =
701
253k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
253k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
253k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
253k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
253k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
253k
    _memory_used_counter =
707
253k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
253k
    _common_profile->add_info_string("IsColocate",
709
253k
                                     std::to_string(_parent->is_colocated_operator()));
710
253k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
253k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
253k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
253k
    return Status::OK();
714
253k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
29
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
29
    _operator_profile =
657
29
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
29
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
29
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
29
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
29
    _operator_profile->add_child(_common_profile, true);
666
29
    _operator_profile->add_child(_custom_profile, true);
667
668
29
    _operator_profile->set_metadata(_parent->node_id());
669
29
    _wait_for_finish_dependency_timer =
670
29
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
29
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
29
    if constexpr (!is_fake_shared) {
673
29
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
29
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
29
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
29
            _shared_state = info.shared_state->template cast<SharedState>();
689
29
            _dependency = _shared_state->create_sink_dependency(
690
29
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
29
        }
692
29
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
29
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
29
    }
695
696
29
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
29
    _rows_input_counter =
701
29
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
29
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
29
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
29
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
29
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
29
    _memory_used_counter =
707
29
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
29
    _common_profile->add_info_string("IsColocate",
709
29
                                     std::to_string(_parent->is_colocated_operator()));
710
29
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
29
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
29
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
29
    return Status::OK();
714
29
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
10.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
10.8k
    _operator_profile =
657
10.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
10.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
10.8k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
10.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
10.8k
    _operator_profile->add_child(_common_profile, true);
666
10.8k
    _operator_profile->add_child(_custom_profile, true);
667
668
10.8k
    _operator_profile->set_metadata(_parent->node_id());
669
10.8k
    _wait_for_finish_dependency_timer =
670
10.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
10.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
10.8k
    if constexpr (!is_fake_shared) {
673
10.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
10.8k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
10.8k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
10.8k
            _shared_state = info.shared_state->template cast<SharedState>();
689
10.8k
            _dependency = _shared_state->create_sink_dependency(
690
10.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
10.8k
        }
692
10.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
10.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
10.8k
    }
695
696
10.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
10.8k
    _rows_input_counter =
701
10.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
10.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
10.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
10.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
10.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
10.8k
    _memory_used_counter =
707
10.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
10.8k
    _common_profile->add_info_string("IsColocate",
709
10.8k
                                     std::to_string(_parent->is_colocated_operator()));
710
10.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
10.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
10.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
10.8k
    return Status::OK();
714
10.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
8.99k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
8.99k
    _operator_profile =
657
8.99k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
8.99k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
8.99k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
8.99k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
8.99k
    _operator_profile->add_child(_common_profile, true);
666
8.99k
    _operator_profile->add_child(_custom_profile, true);
667
668
8.99k
    _operator_profile->set_metadata(_parent->node_id());
669
8.99k
    _wait_for_finish_dependency_timer =
670
8.99k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
8.99k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
8.99k
    if constexpr (!is_fake_shared) {
673
8.99k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
8.99k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
8.99k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
8.99k
            _shared_state = info.shared_state->template cast<SharedState>();
689
8.99k
            _dependency = _shared_state->create_sink_dependency(
690
8.99k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
8.99k
        }
692
8.99k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
8.99k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
8.99k
    }
695
696
8.99k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
8.99k
    _rows_input_counter =
701
8.99k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
8.99k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
8.99k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
8.99k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
8.99k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
8.99k
    _memory_used_counter =
707
8.99k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
8.99k
    _common_profile->add_info_string("IsColocate",
709
8.99k
                                     std::to_string(_parent->is_colocated_operator()));
710
8.99k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
8.99k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
8.99k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
8.99k
    return Status::OK();
714
8.99k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
160k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
160k
    _operator_profile =
657
160k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
160k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
160k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
160k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
160k
    _operator_profile->add_child(_common_profile, true);
666
160k
    _operator_profile->add_child(_custom_profile, true);
667
668
160k
    _operator_profile->set_metadata(_parent->node_id());
669
160k
    _wait_for_finish_dependency_timer =
670
160k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
160k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
160k
    if constexpr (!is_fake_shared) {
673
160k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
160k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
160k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
160k
            _shared_state = info.shared_state->template cast<SharedState>();
689
160k
            _dependency = _shared_state->create_sink_dependency(
690
160k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
160k
        }
692
160k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
160k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
160k
    }
695
696
160k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
160k
    _rows_input_counter =
701
160k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
160k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
160k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
160k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
160k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
160k
    _memory_used_counter =
707
160k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
160k
    _common_profile->add_info_string("IsColocate",
709
160k
                                     std::to_string(_parent->is_colocated_operator()));
710
160k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
160k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
160k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
160k
    return Status::OK();
714
160k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
480
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
480
    _operator_profile =
657
480
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
480
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
480
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
480
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
480
    _operator_profile->add_child(_common_profile, true);
666
480
    _operator_profile->add_child(_custom_profile, true);
667
668
480
    _operator_profile->set_metadata(_parent->node_id());
669
480
    _wait_for_finish_dependency_timer =
670
480
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
480
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
480
    if constexpr (!is_fake_shared) {
673
480
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
482
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
482
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
482
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
482
                                                  ? 0
681
482
                                                  : info.task_idx]
682
482
                                  .get();
683
482
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
18.4E
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
689
18.4E
            _dependency = _shared_state->create_sink_dependency(
690
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
18.4E
        }
692
480
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
480
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
480
    }
695
696
480
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
480
    _rows_input_counter =
701
480
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
480
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
480
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
480
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
480
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
480
    _memory_used_counter =
707
480
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
480
    _common_profile->add_info_string("IsColocate",
709
480
                                     std::to_string(_parent->is_colocated_operator()));
710
480
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
480
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
480
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
480
    return Status::OK();
714
480
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
163
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
163
    _operator_profile =
657
163
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
163
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
163
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
163
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
163
    _operator_profile->add_child(_common_profile, true);
666
163
    _operator_profile->add_child(_custom_profile, true);
667
668
163
    _operator_profile->set_metadata(_parent->node_id());
669
163
    _wait_for_finish_dependency_timer =
670
163
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
163
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
163
    if constexpr (!is_fake_shared) {
673
163
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
163
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
163
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
163
            _shared_state = info.shared_state->template cast<SharedState>();
689
163
            _dependency = _shared_state->create_sink_dependency(
690
163
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
163
        }
692
163
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
163
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
163
    }
695
696
163
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
163
    _rows_input_counter =
701
163
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
163
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
163
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
163
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
163
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
163
    _memory_used_counter =
707
163
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
163
    _common_profile->add_info_string("IsColocate",
709
163
                                     std::to_string(_parent->is_colocated_operator()));
710
163
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
163
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
163
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
163
    return Status::OK();
714
163
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
708k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
708k
    _operator_profile =
657
708k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
708k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
708k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
708k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
708k
    _operator_profile->add_child(_common_profile, true);
666
708k
    _operator_profile->add_child(_custom_profile, true);
667
668
708k
    _operator_profile->set_metadata(_parent->node_id());
669
708k
    _wait_for_finish_dependency_timer =
670
708k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
708k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
    if constexpr (!is_fake_shared) {
673
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
                                                  ? 0
681
                                                  : info.task_idx]
682
                                  .get();
683
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
            _shared_state = info.shared_state->template cast<SharedState>();
689
            _dependency = _shared_state->create_sink_dependency(
690
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
        }
692
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
    }
695
696
708k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
708k
    _rows_input_counter =
701
708k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
708k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
708k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
708k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
708k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
708k
    _memory_used_counter =
707
708k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
708k
    _common_profile->add_info_string("IsColocate",
709
708k
                                     std::to_string(_parent->is_colocated_operator()));
710
708k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
708k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
708k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
708k
    return Status::OK();
714
708k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
5.41k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
5.41k
    _operator_profile =
657
5.41k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
5.41k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
5.41k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
5.41k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
5.41k
    _operator_profile->add_child(_common_profile, true);
666
5.41k
    _operator_profile->add_child(_custom_profile, true);
667
668
5.41k
    _operator_profile->set_metadata(_parent->node_id());
669
5.41k
    _wait_for_finish_dependency_timer =
670
5.41k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
5.41k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
5.41k
    if constexpr (!is_fake_shared) {
673
5.41k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
5.41k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
5.41k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
5.41k
            _shared_state = info.shared_state->template cast<SharedState>();
689
5.41k
            _dependency = _shared_state->create_sink_dependency(
690
5.41k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
5.41k
        }
692
5.41k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
5.41k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
5.41k
    }
695
696
5.41k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
5.41k
    _rows_input_counter =
701
5.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
5.41k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
5.41k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
5.41k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
5.41k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
5.41k
    _memory_used_counter =
707
5.41k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
5.41k
    _common_profile->add_info_string("IsColocate",
709
5.41k
                                     std::to_string(_parent->is_colocated_operator()));
710
5.41k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
5.41k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
5.41k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
5.41k
    return Status::OK();
714
5.41k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
424
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
424
    _operator_profile =
657
424
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
424
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
424
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
424
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
424
    _operator_profile->add_child(_common_profile, true);
666
424
    _operator_profile->add_child(_custom_profile, true);
667
668
424
    _operator_profile->set_metadata(_parent->node_id());
669
424
    _wait_for_finish_dependency_timer =
670
424
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
424
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
424
    if constexpr (!is_fake_shared) {
673
424
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
424
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
424
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
424
            _shared_state = info.shared_state->template cast<SharedState>();
689
424
            _dependency = _shared_state->create_sink_dependency(
690
424
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
424
        }
692
424
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
424
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
424
    }
695
696
425
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
424
    _rows_input_counter =
701
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
424
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
424
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
424
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
424
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
424
    _memory_used_counter =
707
424
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
424
    _common_profile->add_info_string("IsColocate",
709
424
                                     std::to_string(_parent->is_colocated_operator()));
710
424
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
424
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
424
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
424
    return Status::OK();
714
424
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
3.57k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
3.57k
    _operator_profile =
657
3.57k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
3.57k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
3.57k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
3.57k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
3.57k
    _operator_profile->add_child(_common_profile, true);
666
3.57k
    _operator_profile->add_child(_custom_profile, true);
667
668
3.57k
    _operator_profile->set_metadata(_parent->node_id());
669
3.57k
    _wait_for_finish_dependency_timer =
670
3.57k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
3.57k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
3.57k
    if constexpr (!is_fake_shared) {
673
3.57k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
3.57k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
3.57k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
3.57k
            _shared_state = info.shared_state->template cast<SharedState>();
689
3.57k
            _dependency = _shared_state->create_sink_dependency(
690
3.57k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
3.57k
        }
692
3.57k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
3.57k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
3.57k
    }
695
696
3.57k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
3.57k
    _rows_input_counter =
701
3.57k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
3.57k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
3.57k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
3.57k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
3.57k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
3.57k
    _memory_used_counter =
707
3.57k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
3.57k
    _common_profile->add_info_string("IsColocate",
709
3.57k
                                     std::to_string(_parent->is_colocated_operator()));
710
3.57k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
3.57k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
3.57k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
3.57k
    return Status::OK();
714
3.57k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
12.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
12.4k
    _operator_profile =
657
12.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
12.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
12.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
12.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
12.4k
    _operator_profile->add_child(_common_profile, true);
666
12.4k
    _operator_profile->add_child(_custom_profile, true);
667
668
12.4k
    _operator_profile->set_metadata(_parent->node_id());
669
12.4k
    _wait_for_finish_dependency_timer =
670
12.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
12.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
12.4k
    if constexpr (!is_fake_shared) {
673
12.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
12.4k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
12.4k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
12.4k
            _shared_state = info.shared_state->template cast<SharedState>();
689
12.4k
            _dependency = _shared_state->create_sink_dependency(
690
12.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
12.4k
        }
692
12.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
12.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
12.4k
    }
695
696
12.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
12.4k
    _rows_input_counter =
701
12.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
12.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
12.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
12.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
12.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
12.4k
    _memory_used_counter =
707
12.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
12.4k
    _common_profile->add_info_string("IsColocate",
709
12.4k
                                     std::to_string(_parent->is_colocated_operator()));
710
12.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
12.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
12.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
12.4k
    return Status::OK();
714
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
311k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
311k
    _operator_profile =
657
311k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
311k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
311k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
311k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
311k
    _operator_profile->add_child(_common_profile, true);
666
311k
    _operator_profile->add_child(_custom_profile, true);
667
668
311k
    _operator_profile->set_metadata(_parent->node_id());
669
311k
    _wait_for_finish_dependency_timer =
670
311k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
311k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
311k
    if constexpr (!is_fake_shared) {
673
311k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
312k
            info.shared_state_map.end()) {
675
312k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
312k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
312k
            }
678
312k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
312k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
312k
                                                  ? 0
681
312k
                                                  : info.task_idx]
682
312k
                                  .get();
683
312k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
18.4E
        } else {
685
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
18.4E
                DCHECK(false);
687
18.4E
            }
688
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
689
18.4E
            _dependency = _shared_state->create_sink_dependency(
690
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
18.4E
        }
692
311k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
311k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
311k
    }
695
696
311k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
311k
    _rows_input_counter =
701
311k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
311k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
311k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
311k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
311k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
311k
    _memory_used_counter =
707
311k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
311k
    _common_profile->add_info_string("IsColocate",
709
311k
                                     std::to_string(_parent->is_colocated_operator()));
710
311k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
311k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
311k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
311k
    return Status::OK();
714
311k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
521k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
521k
    _operator_profile =
657
521k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
521k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
521k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
521k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
521k
    _operator_profile->add_child(_common_profile, true);
666
521k
    _operator_profile->add_child(_custom_profile, true);
667
668
521k
    _operator_profile->set_metadata(_parent->node_id());
669
521k
    _wait_for_finish_dependency_timer =
670
521k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
521k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
521k
    if constexpr (!is_fake_shared) {
673
521k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
521k
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
521k
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
521k
            _shared_state = info.shared_state->template cast<SharedState>();
689
521k
            _dependency = _shared_state->create_sink_dependency(
690
521k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
521k
        }
692
521k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
521k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
521k
    }
695
696
521k
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
521k
    _rows_input_counter =
701
521k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
521k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
521k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
521k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
521k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
521k
    _memory_used_counter =
707
521k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
521k
    _common_profile->add_info_string("IsColocate",
709
521k
                                     std::to_string(_parent->is_colocated_operator()));
710
521k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
521k
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
521k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
521k
    return Status::OK();
714
521k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
25
    _operator_profile =
657
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
25
    _operator_profile->add_child(_common_profile, true);
666
25
    _operator_profile->add_child(_custom_profile, true);
667
668
25
    _operator_profile->set_metadata(_parent->node_id());
669
25
    _wait_for_finish_dependency_timer =
670
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
25
    if constexpr (!is_fake_shared) {
673
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
25
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
25
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
25
            _shared_state = info.shared_state->template cast<SharedState>();
689
25
            _dependency = _shared_state->create_sink_dependency(
690
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
25
        }
692
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
25
    }
695
696
25
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
25
    _rows_input_counter =
701
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
25
    _memory_used_counter =
707
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
25
    _common_profile->add_info_string("IsColocate",
709
25
                                     std::to_string(_parent->is_colocated_operator()));
710
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
25
    return Status::OK();
714
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
654
328
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
655
    // create profile
656
328
    _operator_profile =
657
328
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
658
328
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
659
328
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
660
661
    // indentation is true
662
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
663
    // So we should set the indentation to true.
664
328
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
665
328
    _operator_profile->add_child(_common_profile, true);
666
328
    _operator_profile->add_child(_custom_profile, true);
667
668
328
    _operator_profile->set_metadata(_parent->node_id());
669
328
    _wait_for_finish_dependency_timer =
670
328
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
671
328
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
672
328
    if constexpr (!is_fake_shared) {
673
328
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
674
328
            info.shared_state_map.end()) {
675
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
676
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
677
            }
678
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
679
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
680
0
                                                  ? 0
681
0
                                                  : info.task_idx]
682
0
                                  .get();
683
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
684
328
        } else {
685
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
686
                DCHECK(false);
687
            }
688
328
            _shared_state = info.shared_state->template cast<SharedState>();
689
328
            _dependency = _shared_state->create_sink_dependency(
690
328
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
691
328
        }
692
328
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
693
328
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
694
328
    }
695
696
328
    if (must_set_shared_state() && _shared_state == nullptr) {
697
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
698
0
    }
699
700
328
    _rows_input_counter =
701
328
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
702
328
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
703
328
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
704
328
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
705
328
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
706
328
    _memory_used_counter =
707
328
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
708
328
    _common_profile->add_info_string("IsColocate",
709
328
                                     std::to_string(_parent->is_colocated_operator()));
710
328
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
711
328
    _common_profile->add_info_string("FollowedByShuffledOperator",
712
328
                                     std::to_string(_parent->followed_by_shuffled_operator()));
713
328
    return Status::OK();
714
328
}
715
716
template <typename SharedState>
717
2.12M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
2.12M
    if (_closed) {
719
2
        return Status::OK();
720
2
    }
721
2.12M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
1.41M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
1.41M
    }
724
2.12M
    _closed = true;
725
2.12M
    return Status::OK();
726
2.12M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
123k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
123k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
123k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
123k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
123k
    }
724
123k
    _closed = true;
725
123k
    return Status::OK();
726
123k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
1
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
1
    }
724
1
    _closed = true;
725
1
    return Status::OK();
726
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
252k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
252k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
252k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
252k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
252k
    }
724
252k
    _closed = true;
725
252k
    return Status::OK();
726
252k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
20
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
20
    if (_closed) {
719
2
        return Status::OK();
720
2
    }
721
18
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
18
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
18
    }
724
18
    _closed = true;
725
18
    return Status::OK();
726
20
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
10.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
10.8k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
10.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
10.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
10.8k
    }
724
10.8k
    _closed = true;
725
10.8k
    return Status::OK();
726
10.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
9.00k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
9.00k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
9.00k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
9.00k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
9.00k
    }
724
9.00k
    _closed = true;
725
9.00k
    return Status::OK();
726
9.00k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
159k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
159k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
159k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
159k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
159k
    }
724
159k
    _closed = true;
725
159k
    return Status::OK();
726
159k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
480
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
480
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
480
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
480
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
480
    }
724
480
    _closed = true;
725
480
    return Status::OK();
726
480
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
152
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
152
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
152
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
152
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
152
    }
724
152
    _closed = true;
725
152
    return Status::OK();
726
152
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
708k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
708k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
    }
724
708k
    _closed = true;
725
708k
    return Status::OK();
726
708k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
5.41k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
5.41k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
5.41k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
5.41k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
5.41k
    }
724
5.41k
    _closed = true;
725
5.41k
    return Status::OK();
726
5.41k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
325
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
325
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
325
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
325
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
325
    }
724
325
    _closed = true;
725
325
    return Status::OK();
726
325
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
3.57k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
3.57k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
3.57k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
3.57k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
3.57k
    }
724
3.57k
    _closed = true;
725
3.57k
    return Status::OK();
726
3.57k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
12.5k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
12.5k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
12.5k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
12.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
12.5k
    }
724
12.5k
    _closed = true;
725
12.5k
    return Status::OK();
726
12.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
312k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
312k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
312k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
312k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
312k
    }
724
312k
    _closed = true;
725
312k
    return Status::OK();
726
312k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
525k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
525k
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
525k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
525k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
525k
    }
724
525k
    _closed = true;
725
525k
    return Status::OK();
726
525k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
14
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
14
    }
724
14
    _closed = true;
725
14
    return Status::OK();
726
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
717
328
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
718
328
    if (_closed) {
719
0
        return Status::OK();
720
0
    }
721
328
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
722
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
723
328
    }
724
328
    _closed = true;
725
328
    return Status::OK();
726
328
}
727
728
template <typename LocalStateType>
729
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
730
15.8k
                                                          bool* eos) {
731
15.8k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
732
15.7k
    return pull(state, block, eos);
733
15.8k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
730
431
                                                          bool* eos) {
731
431
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
732
431
    return pull(state, block, eos);
733
431
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
730
15.3k
                                                          bool* eos) {
731
15.3k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
732
15.3k
    return pull(state, block, eos);
733
15.3k
}
734
735
template <typename LocalStateType>
736
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
739k
                                                         bool* eos) {
738
739k
    auto& local_state = get_local_state(state);
739
739k
    if (need_more_input_data(state)) {
740
709k
        local_state._child_block->clear_column_data(
741
709k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
709k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
709k
                state, local_state._child_block.get(), &local_state._child_eos));
744
709k
        *eos = local_state._child_eos;
745
709k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
76.3k
            return Status::OK();
747
76.3k
        }
748
632k
        {
749
632k
            SCOPED_TIMER(local_state.exec_time_counter());
750
632k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
632k
        }
752
632k
    }
753
754
662k
    if (!need_more_input_data(state)) {
755
610k
        SCOPED_TIMER(local_state.exec_time_counter());
756
610k
        bool new_eos = false;
757
610k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
610k
        if (new_eos) {
759
529k
            *eos = true;
760
529k
        } else if (!need_more_input_data(state)) {
761
23.2k
            *eos = false;
762
23.2k
        }
763
610k
    }
764
662k
    return Status::OK();
765
662k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
154k
                                                         bool* eos) {
738
154k
    auto& local_state = get_local_state(state);
739
154k
    if (need_more_input_data(state)) {
740
136k
        local_state._child_block->clear_column_data(
741
136k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
136k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
136k
                state, local_state._child_block.get(), &local_state._child_eos));
744
136k
        *eos = local_state._child_eos;
745
136k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
45.3k
            return Status::OK();
747
45.3k
        }
748
90.9k
        {
749
90.9k
            SCOPED_TIMER(local_state.exec_time_counter());
750
90.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
90.9k
        }
752
90.9k
    }
753
754
109k
    if (!need_more_input_data(state)) {
755
109k
        SCOPED_TIMER(local_state.exec_time_counter());
756
109k
        bool new_eos = false;
757
109k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
109k
        if (new_eos) {
759
51.3k
            *eos = true;
760
58.0k
        } else if (!need_more_input_data(state)) {
761
9.87k
            *eos = false;
762
9.87k
        }
763
109k
    }
764
109k
    return Status::OK();
765
109k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.34k
                                                         bool* eos) {
738
4.34k
    auto& local_state = get_local_state(state);
739
4.34k
    if (need_more_input_data(state)) {
740
2.53k
        local_state._child_block->clear_column_data(
741
2.53k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
2.53k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
2.53k
                state, local_state._child_block.get(), &local_state._child_eos));
744
2.53k
        *eos = local_state._child_eos;
745
2.53k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
586
            return Status::OK();
747
586
        }
748
1.94k
        {
749
1.94k
            SCOPED_TIMER(local_state.exec_time_counter());
750
1.94k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
1.94k
        }
752
1.94k
    }
753
754
3.76k
    if (!need_more_input_data(state)) {
755
3.76k
        SCOPED_TIMER(local_state.exec_time_counter());
756
3.76k
        bool new_eos = false;
757
3.76k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
3.76k
        if (new_eos) {
759
1.32k
            *eos = true;
760
2.43k
        } else if (!need_more_input_data(state)) {
761
1.81k
            *eos = false;
762
1.81k
        }
763
3.76k
    }
764
3.76k
    return Status::OK();
765
3.76k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.91k
                                                         bool* eos) {
738
4.91k
    auto& local_state = get_local_state(state);
739
4.91k
    if (need_more_input_data(state)) {
740
4.91k
        local_state._child_block->clear_column_data(
741
4.91k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
4.91k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
4.91k
                state, local_state._child_block.get(), &local_state._child_eos));
744
4.91k
        *eos = local_state._child_eos;
745
4.91k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
1.71k
            return Status::OK();
747
1.71k
        }
748
3.19k
        {
749
3.19k
            SCOPED_TIMER(local_state.exec_time_counter());
750
3.19k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
3.19k
        }
752
3.19k
    }
753
754
3.19k
    if (!need_more_input_data(state)) {
755
3.19k
        SCOPED_TIMER(local_state.exec_time_counter());
756
3.19k
        bool new_eos = false;
757
3.19k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
3.19k
        if (new_eos) {
759
1.73k
            *eos = true;
760
1.73k
        } else if (!need_more_input_data(state)) {
761
0
            *eos = false;
762
0
        }
763
3.19k
    }
764
3.19k
    return Status::OK();
765
3.19k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
38.6k
                                                         bool* eos) {
738
38.6k
    auto& local_state = get_local_state(state);
739
38.7k
    if (need_more_input_data(state)) {
740
38.7k
        local_state._child_block->clear_column_data(
741
38.7k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
38.7k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
38.7k
                state, local_state._child_block.get(), &local_state._child_eos));
744
38.7k
        *eos = local_state._child_eos;
745
38.7k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
6.16k
            return Status::OK();
747
6.16k
        }
748
32.5k
        {
749
32.5k
            SCOPED_TIMER(local_state.exec_time_counter());
750
32.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
32.5k
        }
752
32.5k
    }
753
754
32.5k
    if (!need_more_input_data(state)) {
755
11.8k
        SCOPED_TIMER(local_state.exec_time_counter());
756
11.8k
        bool new_eos = false;
757
11.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
11.8k
        if (new_eos) {
759
11.7k
            *eos = true;
760
11.7k
        } else if (!need_more_input_data(state)) {
761
5
            *eos = false;
762
5
        }
763
11.8k
    }
764
32.5k
    return Status::OK();
765
32.5k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
498k
                                                         bool* eos) {
738
498k
    auto& local_state = get_local_state(state);
739
500k
    if (need_more_input_data(state)) {
740
500k
        local_state._child_block->clear_column_data(
741
500k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
500k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
500k
                state, local_state._child_block.get(), &local_state._child_eos));
744
500k
        *eos = local_state._child_eos;
745
500k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
19.3k
            return Status::OK();
747
19.3k
        }
748
480k
        {
749
480k
            SCOPED_TIMER(local_state.exec_time_counter());
750
480k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
480k
        }
752
480k
    }
753
754
479k
    if (!need_more_input_data(state)) {
755
448k
        SCOPED_TIMER(local_state.exec_time_counter());
756
448k
        bool new_eos = false;
757
448k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
448k
        if (new_eos) {
759
447k
            *eos = true;
760
447k
        } else if (!need_more_input_data(state)) {
761
0
            *eos = false;
762
0
        }
763
448k
    }
764
479k
    return Status::OK();
765
479k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
30.4k
                                                         bool* eos) {
738
30.4k
    auto& local_state = get_local_state(state);
739
30.4k
    if (need_more_input_data(state)) {
740
19.2k
        local_state._child_block->clear_column_data(
741
19.2k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
19.2k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
19.2k
                state, local_state._child_block.get(), &local_state._child_eos));
744
19.2k
        *eos = local_state._child_eos;
745
19.2k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
2.85k
            return Status::OK();
747
2.85k
        }
748
16.4k
        {
749
16.4k
            SCOPED_TIMER(local_state.exec_time_counter());
750
16.4k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
16.4k
        }
752
16.4k
    }
753
754
27.5k
    if (!need_more_input_data(state)) {
755
27.0k
        SCOPED_TIMER(local_state.exec_time_counter());
756
27.0k
        bool new_eos = false;
757
27.0k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
27.0k
        if (new_eos) {
759
10.8k
            *eos = true;
760
16.2k
        } else if (!need_more_input_data(state)) {
761
11.1k
            *eos = false;
762
11.1k
        }
763
27.0k
    }
764
27.5k
    return Status::OK();
765
27.5k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
7.67k
                                                         bool* eos) {
738
7.67k
    auto& local_state = get_local_state(state);
739
7.67k
    if (need_more_input_data(state)) {
740
7.32k
        local_state._child_block->clear_column_data(
741
7.32k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
742
7.32k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
743
7.32k
                state, local_state._child_block.get(), &local_state._child_eos));
744
7.32k
        *eos = local_state._child_eos;
745
7.32k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
746
386
            return Status::OK();
747
386
        }
748
6.93k
        {
749
6.93k
            SCOPED_TIMER(local_state.exec_time_counter());
750
6.93k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
751
6.93k
        }
752
6.93k
    }
753
754
7.29k
    if (!need_more_input_data(state)) {
755
7.29k
        SCOPED_TIMER(local_state.exec_time_counter());
756
7.29k
        bool new_eos = false;
757
7.29k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
758
7.29k
        if (new_eos) {
759
5.21k
            *eos = true;
760
5.21k
        } else if (!need_more_input_data(state)) {
761
366
            *eos = false;
762
366
        }
763
7.29k
    }
764
7.28k
    return Status::OK();
765
7.28k
}
766
767
template <typename Writer, typename Parent>
768
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
769
69.3k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
69.3k
    RETURN_IF_ERROR(Base::init(state, info));
771
69.3k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
69.3k
                                                         "AsyncWriterDependency", true);
773
69.3k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
69.3k
                             _finish_dependency));
775
776
69.3k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
69.3k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
69.3k
    return Status::OK();
779
69.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
522
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
522
    RETURN_IF_ERROR(Base::init(state, info));
771
522
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
522
                                                         "AsyncWriterDependency", true);
773
522
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
522
                             _finish_dependency));
775
776
522
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
522
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
522
    return Status::OK();
779
522
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
86
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
86
    RETURN_IF_ERROR(Base::init(state, info));
771
86
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
86
                                                         "AsyncWriterDependency", true);
773
86
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
86
                             _finish_dependency));
775
776
86
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
86
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
86
    return Status::OK();
779
86
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
47.4k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
47.4k
    RETURN_IF_ERROR(Base::init(state, info));
771
47.4k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
47.4k
                                                         "AsyncWriterDependency", true);
773
47.4k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
47.4k
                             _finish_dependency));
775
776
47.4k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
47.4k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
47.4k
    return Status::OK();
779
47.4k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
9.59k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
9.59k
    RETURN_IF_ERROR(Base::init(state, info));
771
9.59k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
9.59k
                                                         "AsyncWriterDependency", true);
773
9.59k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
9.59k
                             _finish_dependency));
775
776
9.59k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
9.59k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
9.59k
    return Status::OK();
779
9.59k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
5.04k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
5.04k
    RETURN_IF_ERROR(Base::init(state, info));
771
5.04k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
5.04k
                                                         "AsyncWriterDependency", true);
773
5.04k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
5.04k
                             _finish_dependency));
775
776
5.04k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
5.04k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
5.04k
    return Status::OK();
779
5.04k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
4.00k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
4.00k
    RETURN_IF_ERROR(Base::init(state, info));
771
4.00k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
4.00k
                                                         "AsyncWriterDependency", true);
773
4.00k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
4.00k
                             _finish_dependency));
775
776
4.00k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
4.00k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
4.00k
    return Status::OK();
779
4.00k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
48
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
48
    RETURN_IF_ERROR(Base::init(state, info));
771
48
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
48
                                                         "AsyncWriterDependency", true);
773
48
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
48
                             _finish_dependency));
775
776
48
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
48
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
48
    return Status::OK();
779
48
}
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
704
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
704
    RETURN_IF_ERROR(Base::init(state, info));
771
704
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
704
                                                         "AsyncWriterDependency", true);
773
704
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
704
                             _finish_dependency));
775
776
704
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
704
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
704
    return Status::OK();
779
704
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
1.68k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
1.68k
    RETURN_IF_ERROR(Base::init(state, info));
771
1.68k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
1.68k
                                                         "AsyncWriterDependency", true);
773
1.68k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
1.68k
                             _finish_dependency));
775
776
1.68k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
1.68k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
1.68k
    return Status::OK();
779
1.68k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
769
156
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
770
156
    RETURN_IF_ERROR(Base::init(state, info));
771
156
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
772
156
                                                         "AsyncWriterDependency", true);
773
156
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
774
156
                             _finish_dependency));
775
776
156
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
777
156
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
778
156
    return Status::OK();
779
156
}
780
781
template <typename Writer, typename Parent>
782
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
783
69.6k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
69.6k
    RETURN_IF_ERROR(Base::open(state));
785
69.6k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
603k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
533k
        RETURN_IF_ERROR(
788
533k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
533k
    }
790
69.6k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
69.6k
    return Status::OK();
792
69.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
522
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
522
    RETURN_IF_ERROR(Base::open(state));
785
522
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
2.79k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
2.27k
        RETURN_IF_ERROR(
788
2.27k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
2.27k
    }
790
522
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
522
    return Status::OK();
792
522
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
86
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
86
    RETURN_IF_ERROR(Base::open(state));
785
86
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
402
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
316
        RETURN_IF_ERROR(
788
316
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
316
    }
790
86
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
86
    return Status::OK();
792
86
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
48.0k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
48.0k
    RETURN_IF_ERROR(Base::open(state));
785
48.0k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
346k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
298k
        RETURN_IF_ERROR(
788
298k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
298k
    }
790
48.0k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
48.0k
    return Status::OK();
792
48.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
9.37k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
9.37k
    RETURN_IF_ERROR(Base::open(state));
785
9.37k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
57.9k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
48.5k
        RETURN_IF_ERROR(
788
48.5k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
48.5k
    }
790
9.37k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
9.37k
    return Status::OK();
792
9.37k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
5.02k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
5.02k
    RETURN_IF_ERROR(Base::open(state));
785
5.02k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
135k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
130k
        RETURN_IF_ERROR(
788
130k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
130k
    }
790
5.02k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
5.02k
    return Status::OK();
792
5.02k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
3.99k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
3.99k
    RETURN_IF_ERROR(Base::open(state));
785
3.99k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
44.3k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
40.3k
        RETURN_IF_ERROR(
788
40.3k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
40.3k
    }
790
3.99k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
3.99k
    return Status::OK();
792
3.99k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
48
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
48
    RETURN_IF_ERROR(Base::open(state));
785
48
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
204
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
156
        RETURN_IF_ERROR(
788
156
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
156
    }
790
48
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
48
    return Status::OK();
792
48
}
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
702
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
702
    RETURN_IF_ERROR(Base::open(state));
785
702
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
2.10k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
1.40k
        RETURN_IF_ERROR(
788
1.40k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
1.40k
    }
790
702
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
702
    return Status::OK();
792
702
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
1.67k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
1.67k
    RETURN_IF_ERROR(Base::open(state));
785
1.67k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
13.1k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
11.5k
        RETURN_IF_ERROR(
788
11.5k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
11.5k
    }
790
1.67k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
1.67k
    return Status::OK();
792
1.67k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
783
156
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
784
156
    RETURN_IF_ERROR(Base::open(state));
785
156
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
786
786
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
787
630
        RETURN_IF_ERROR(
788
630
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
789
630
    }
790
156
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
791
156
    return Status::OK();
792
156
}
793
794
template <typename Writer, typename Parent>
795
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
796
95.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
95.0k
    return _writer->sink(block, eos);
798
95.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
2.06k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
2.06k
    return _writer->sink(block, eos);
798
2.06k
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
110
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
110
    return _writer->sink(block, eos);
798
110
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
64.8k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
64.8k
    return _writer->sink(block, eos);
798
64.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
11.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
11.0k
    return _writer->sink(block, eos);
798
11.0k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
7.29k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
7.29k
    return _writer->sink(block, eos);
798
7.29k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
6.38k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
6.38k
    return _writer->sink(block, eos);
798
6.38k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
60
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
60
    return _writer->sink(block, eos);
798
60
}
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
794
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
794
    return _writer->sink(block, eos);
798
794
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
2.12k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
2.12k
    return _writer->sink(block, eos);
798
2.12k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
796
310
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
797
310
    return _writer->sink(block, eos);
798
310
}
799
800
template <typename Writer, typename Parent>
801
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
802
69.8k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
69.8k
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
69.8k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
69.8k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
69.9k
    if (_writer) {
810
69.9k
        Status st = _writer->get_writer_status();
811
69.9k
        if (exec_status.ok()) {
812
69.8k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
69.8k
                                                       : Status::Cancelled("force close"));
814
69.8k
        } else {
815
110
            _writer->force_close(exec_status);
816
110
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
69.9k
        RETURN_IF_ERROR(st);
821
69.9k
    }
822
69.8k
    return Base::close(state, exec_status);
823
69.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
511
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
511
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
511
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
511
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
511
    if (_writer) {
810
511
        Status st = _writer->get_writer_status();
811
511
        if (exec_status.ok()) {
812
511
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
511
                                                       : Status::Cancelled("force close"));
814
511
        } else {
815
0
            _writer->force_close(exec_status);
816
0
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
511
        RETURN_IF_ERROR(st);
821
511
    }
822
511
    return Base::close(state, exec_status);
823
511
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
86
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
86
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
86
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
86
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
86
    if (_writer) {
810
86
        Status st = _writer->get_writer_status();
811
86
        if (exec_status.ok()) {
812
86
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
86
                                                       : Status::Cancelled("force close"));
814
86
        } else {
815
0
            _writer->force_close(exec_status);
816
0
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
86
        RETURN_IF_ERROR(st);
821
86
    }
822
78
    return Base::close(state, exec_status);
823
86
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
48.1k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
48.1k
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
48.1k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
48.1k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
48.1k
    if (_writer) {
810
48.1k
        Status st = _writer->get_writer_status();
811
48.1k
        if (exec_status.ok()) {
812
48.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
48.1k
                                                       : Status::Cancelled("force close"));
814
48.1k
        } else {
815
60
            _writer->force_close(exec_status);
816
60
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
48.1k
        RETURN_IF_ERROR(st);
821
48.1k
    }
822
48.0k
    return Base::close(state, exec_status);
823
48.1k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
9.52k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
9.52k
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
9.52k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
9.52k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
9.58k
    if (_writer) {
810
9.58k
        Status st = _writer->get_writer_status();
811
9.58k
        if (exec_status.ok()) {
812
9.53k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
9.53k
                                                       : Status::Cancelled("force close"));
814
9.53k
        } else {
815
52
            _writer->force_close(exec_status);
816
52
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
9.58k
        RETURN_IF_ERROR(st);
821
9.58k
    }
822
9.52k
    return Base::close(state, exec_status);
823
9.52k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
5.03k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
5.03k
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
5.03k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
5.03k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
5.04k
    if (_writer) {
810
5.04k
        Status st = _writer->get_writer_status();
811
5.04k
        if (exec_status.ok()) {
812
5.03k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
5.03k
                                                       : Status::Cancelled("force close"));
814
5.03k
        } else {
815
2
            _writer->force_close(exec_status);
816
2
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
5.04k
        RETURN_IF_ERROR(st);
821
5.04k
    }
822
5.03k
    return Base::close(state, exec_status);
823
5.03k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
4.00k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
4.00k
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
4.00k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
4.00k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
4.00k
    if (_writer) {
810
4.00k
        Status st = _writer->get_writer_status();
811
4.00k
        if (exec_status.ok()) {
812
4.00k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
4.00k
                                                       : Status::Cancelled("force close"));
814
18.4E
        } else {
815
18.4E
            _writer->force_close(exec_status);
816
18.4E
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
4.00k
        RETURN_IF_ERROR(st);
821
4.00k
    }
822
3.99k
    return Base::close(state, exec_status);
823
4.00k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
48
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
48
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
48
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
48
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
48
    if (_writer) {
810
48
        Status st = _writer->get_writer_status();
811
48
        if (exec_status.ok()) {
812
48
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
48
                                                       : Status::Cancelled("force close"));
814
48
        } else {
815
0
            _writer->force_close(exec_status);
816
0
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
48
        RETURN_IF_ERROR(st);
821
48
    }
822
48
    return Base::close(state, exec_status);
823
48
}
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
704
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
704
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
704
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
704
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
704
    if (_writer) {
810
702
        Status st = _writer->get_writer_status();
811
704
        if (exec_status.ok()) {
812
704
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
704
                                                       : Status::Cancelled("force close"));
814
18.4E
        } else {
815
18.4E
            _writer->force_close(exec_status);
816
18.4E
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
702
        RETURN_IF_ERROR(st);
821
702
    }
822
704
    return Base::close(state, exec_status);
823
704
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
1.67k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
1.67k
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
1.67k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
1.67k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
1.68k
    if (_writer) {
810
1.68k
        Status st = _writer->get_writer_status();
811
1.68k
        if (exec_status.ok()) {
812
1.68k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
1.68k
                                                       : Status::Cancelled("force close"));
814
1.68k
        } else {
815
0
            _writer->force_close(exec_status);
816
0
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
1.68k
        RETURN_IF_ERROR(st);
821
1.68k
    }
822
1.67k
    return Base::close(state, exec_status);
823
1.67k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
802
156
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
803
156
    if (_closed) {
804
0
        return Status::OK();
805
0
    }
806
156
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
807
156
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
808
    // if the init failed, the _writer may be nullptr. so here need check
809
156
    if (_writer) {
810
156
        Status st = _writer->get_writer_status();
811
156
        if (exec_status.ok()) {
812
156
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
813
156
                                                       : Status::Cancelled("force close"));
814
156
        } else {
815
0
            _writer->force_close(exec_status);
816
0
        }
817
        // If there is an error in process_block thread, then we should get the writer
818
        // status before call force_close. For example, the thread may failed in commit
819
        // transaction.
820
156
        RETURN_IF_ERROR(st);
821
156
    }
822
156
    return Base::close(state, exec_status);
823
156
}
824
825
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
826
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
827
DECLARE_OPERATOR(ResultSinkLocalState)
828
DECLARE_OPERATOR(JdbcTableSinkLocalState)
829
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
830
DECLARE_OPERATOR(ResultFileSinkLocalState)
831
DECLARE_OPERATOR(OlapTableSinkLocalState)
832
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
833
DECLARE_OPERATOR(HiveTableSinkLocalState)
834
DECLARE_OPERATOR(TVFTableSinkLocalState)
835
DECLARE_OPERATOR(IcebergTableSinkLocalState)
836
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
837
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
838
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
839
DECLARE_OPERATOR(MCTableSinkLocalState)
840
DECLARE_OPERATOR(AnalyticSinkLocalState)
841
DECLARE_OPERATOR(BlackholeSinkLocalState)
842
DECLARE_OPERATOR(SortSinkLocalState)
843
DECLARE_OPERATOR(SpillSortSinkLocalState)
844
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
845
DECLARE_OPERATOR(AggSinkLocalState)
846
DECLARE_OPERATOR(BucketedAggSinkLocalState)
847
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
848
DECLARE_OPERATOR(ExchangeSinkLocalState)
849
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
850
DECLARE_OPERATOR(UnionSinkLocalState)
851
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
852
DECLARE_OPERATOR(PartitionSortSinkLocalState)
853
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
854
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
855
DECLARE_OPERATOR(SetSinkLocalState<true>)
856
DECLARE_OPERATOR(SetSinkLocalState<false>)
857
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
858
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
859
DECLARE_OPERATOR(CacheSinkLocalState)
860
DECLARE_OPERATOR(DictSinkLocalState)
861
DECLARE_OPERATOR(RecCTESinkLocalState)
862
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
863
864
#undef DECLARE_OPERATOR
865
866
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
867
DECLARE_OPERATOR(HashJoinProbeLocalState)
868
DECLARE_OPERATOR(OlapScanLocalState)
869
DECLARE_OPERATOR(GroupCommitLocalState)
870
DECLARE_OPERATOR(JDBCScanLocalState)
871
DECLARE_OPERATOR(FileScanLocalState)
872
DECLARE_OPERATOR(AnalyticLocalState)
873
DECLARE_OPERATOR(SortLocalState)
874
DECLARE_OPERATOR(SpillSortLocalState)
875
DECLARE_OPERATOR(LocalMergeSortLocalState)
876
DECLARE_OPERATOR(AggLocalState)
877
DECLARE_OPERATOR(BucketedAggLocalState)
878
DECLARE_OPERATOR(PartitionedAggLocalState)
879
DECLARE_OPERATOR(TableFunctionLocalState)
880
DECLARE_OPERATOR(ExchangeLocalState)
881
DECLARE_OPERATOR(RepeatLocalState)
882
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
883
DECLARE_OPERATOR(AssertNumRowsLocalState)
884
DECLARE_OPERATOR(EmptySetLocalState)
885
DECLARE_OPERATOR(UnionSourceLocalState)
886
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
887
DECLARE_OPERATOR(PartitionSortSourceLocalState)
888
DECLARE_OPERATOR(SetSourceLocalState<true>)
889
DECLARE_OPERATOR(SetSourceLocalState<false>)
890
DECLARE_OPERATOR(DataGenLocalState)
891
DECLARE_OPERATOR(SchemaScanLocalState)
892
DECLARE_OPERATOR(MetaScanLocalState)
893
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
894
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
895
DECLARE_OPERATOR(CacheSourceLocalState)
896
DECLARE_OPERATOR(RecCTESourceLocalState)
897
DECLARE_OPERATOR(RecCTEScanLocalState)
898
899
#ifdef BE_TEST
900
DECLARE_OPERATOR(MockLocalState)
901
DECLARE_OPERATOR(MockScanLocalState)
902
#endif
903
#undef DECLARE_OPERATOR
904
905
template class StreamingOperatorX<AssertNumRowsLocalState>;
906
template class StreamingOperatorX<SelectLocalState>;
907
908
template class StatefulOperatorX<HashJoinProbeLocalState>;
909
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
910
template class StatefulOperatorX<RepeatLocalState>;
911
template class StatefulOperatorX<MaterializationLocalState>;
912
template class StatefulOperatorX<StreamingAggLocalState>;
913
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
914
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
915
template class StatefulOperatorX<TableFunctionLocalState>;
916
917
template class PipelineXSinkLocalState<HashJoinSharedState>;
918
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
919
template class PipelineXSinkLocalState<SortSharedState>;
920
template class PipelineXSinkLocalState<SpillSortSharedState>;
921
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
922
template class PipelineXSinkLocalState<AnalyticSharedState>;
923
template class PipelineXSinkLocalState<AggSharedState>;
924
template class PipelineXSinkLocalState<BucketedAggSharedState>;
925
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
926
template class PipelineXSinkLocalState<FakeSharedState>;
927
template class PipelineXSinkLocalState<UnionSharedState>;
928
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
929
template class PipelineXSinkLocalState<MultiCastSharedState>;
930
template class PipelineXSinkLocalState<SetSharedState>;
931
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
932
template class PipelineXSinkLocalState<BasicSharedState>;
933
template class PipelineXSinkLocalState<DataQueueSharedState>;
934
template class PipelineXSinkLocalState<RecCTESharedState>;
935
936
template class PipelineXLocalState<HashJoinSharedState>;
937
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
938
template class PipelineXLocalState<SortSharedState>;
939
template class PipelineXLocalState<SpillSortSharedState>;
940
template class PipelineXLocalState<NestedLoopJoinSharedState>;
941
template class PipelineXLocalState<AnalyticSharedState>;
942
template class PipelineXLocalState<AggSharedState>;
943
template class PipelineXLocalState<BucketedAggSharedState>;
944
template class PipelineXLocalState<PartitionedAggSharedState>;
945
template class PipelineXLocalState<FakeSharedState>;
946
template class PipelineXLocalState<UnionSharedState>;
947
template class PipelineXLocalState<DataQueueSharedState>;
948
template class PipelineXLocalState<MultiCastSharedState>;
949
template class PipelineXLocalState<PartitionSortNodeSharedState>;
950
template class PipelineXLocalState<SetSharedState>;
951
template class PipelineXLocalState<LocalExchangeSharedState>;
952
template class PipelineXLocalState<BasicSharedState>;
953
template class PipelineXLocalState<RecCTESharedState>;
954
955
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
956
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
957
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
958
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
959
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
960
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
961
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
962
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
963
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
964
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
965
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
966
967
#ifdef BE_TEST
968
template class OperatorX<DummyOperatorLocalState>;
969
template class DataSinkOperatorX<DummySinkLocalState>;
970
#endif
971
972
} // namespace doris