Coverage Report

Created: 2026-09-02 15:27

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/operator/operator.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "exec/operator/operator.h"
19
20
#include <algorithm>
21
22
#include "common/status.h"
23
#include "exec/common/util.hpp"
24
#include "exec/exchange/local_exchange_sink_operator.h"
25
#include "exec/exchange/local_exchange_source_operator.h"
26
#include "exec/operator/aggregation_sink_operator.h"
27
#include "exec/operator/aggregation_source_operator.h"
28
#include "exec/operator/analytic_sink_operator.h"
29
#include "exec/operator/analytic_source_operator.h"
30
#include "exec/operator/assert_num_rows_operator.h"
31
#include "exec/operator/blackhole_sink_operator.h"
32
#include "exec/operator/bucketed_aggregation_sink_operator.h"
33
#include "exec/operator/bucketed_aggregation_source_operator.h"
34
#include "exec/operator/cache_sink_operator.h"
35
#include "exec/operator/cache_source_operator.h"
36
#include "exec/operator/datagen_operator.h"
37
#include "exec/operator/dict_sink_operator.h"
38
#include "exec/operator/distinct_streaming_aggregation_operator.h"
39
#include "exec/operator/empty_set_operator.h"
40
#include "exec/operator/exchange_sink_operator.h"
41
#include "exec/operator/exchange_source_operator.h"
42
#include "exec/operator/file_scan_operator.h"
43
#include "exec/operator/group_commit_block_sink_operator.h"
44
#include "exec/operator/group_commit_scan_operator.h"
45
#include "exec/operator/hashjoin_build_sink.h"
46
#include "exec/operator/hashjoin_probe_operator.h"
47
#include "exec/operator/hive_table_sink_operator.h"
48
#include "exec/operator/iceberg_delete_sink_operator.h"
49
#include "exec/operator/iceberg_merge_sink_operator.h"
50
#include "exec/operator/iceberg_table_sink_operator.h"
51
#include "exec/operator/jdbc_scan_operator.h"
52
#include "exec/operator/jdbc_table_sink_operator.h"
53
#include "exec/operator/local_merge_sort_source_operator.h"
54
#include "exec/operator/materialization_opertor.h"
55
#include "exec/operator/maxcompute_table_sink_operator.h"
56
#include "exec/operator/memory_scratch_sink_operator.h"
57
#include "exec/operator/meta_scan_operator.h"
58
#include "exec/operator/mock_operator.h"
59
#include "exec/operator/mock_scan_operator.h"
60
#include "exec/operator/multi_cast_data_stream_sink.h"
61
#include "exec/operator/multi_cast_data_stream_source.h"
62
#include "exec/operator/nested_loop_join_build_operator.h"
63
#include "exec/operator/nested_loop_join_probe_operator.h"
64
#include "exec/operator/olap_scan_operator.h"
65
#include "exec/operator/olap_table_sink_operator.h"
66
#include "exec/operator/olap_table_sink_v2_operator.h"
67
#include "exec/operator/partition_sort_sink_operator.h"
68
#include "exec/operator/partition_sort_source_operator.h"
69
#include "exec/operator/partitioned_aggregation_sink_operator.h"
70
#include "exec/operator/partitioned_aggregation_source_operator.h"
71
#include "exec/operator/partitioned_hash_join_probe_operator.h"
72
#include "exec/operator/partitioned_hash_join_sink_operator.h"
73
#include "exec/operator/rec_cte_anchor_sink_operator.h"
74
#include "exec/operator/rec_cte_scan_operator.h"
75
#include "exec/operator/rec_cte_sink_operator.h"
76
#include "exec/operator/rec_cte_source_operator.h"
77
#include "exec/operator/repeat_operator.h"
78
#include "exec/operator/result_file_sink_operator.h"
79
#include "exec/operator/result_sink_operator.h"
80
#include "exec/operator/schema_scan_operator.h"
81
#include "exec/operator/select_operator.h"
82
#include "exec/operator/set_probe_sink_operator.h"
83
#include "exec/operator/set_sink_operator.h"
84
#include "exec/operator/set_source_operator.h"
85
#include "exec/operator/sort_sink_operator.h"
86
#include "exec/operator/sort_source_operator.h"
87
#include "exec/operator/spill_iceberg_table_sink_operator.h"
88
#include "exec/operator/spill_sort_sink_operator.h"
89
#include "exec/operator/spill_sort_source_operator.h"
90
#include "exec/operator/streaming_aggregation_operator.h"
91
#include "exec/operator/table_function_operator.h"
92
#include "exec/operator/tvf_table_sink_operator.h"
93
#include "exec/operator/union_sink_operator.h"
94
#include "exec/operator/union_source_operator.h"
95
#include "exec/pipeline/dependency.h"
96
#include "exec/pipeline/pipeline.h"
97
#include "exprs/vexpr.h"
98
#include "exprs/vexpr_context.h"
99
#include "runtime/runtime_profile.h"
100
#include "runtime/runtime_profile_counter_names.h"
101
#include "util/debug_util.h"
102
#include "util/string_util.h"
103
104
namespace doris {
105
class RowDescriptor;
106
class RuntimeState;
107
} // namespace doris
108
109
namespace doris {
110
111
0
Status OperatorBase::close(RuntimeState* state) {
112
0
    if (_is_closed) {
113
0
        return Status::OK();
114
0
    }
115
0
    _is_closed = true;
116
0
    return Status::OK();
117
0
}
118
119
template <typename SharedStateArg>
120
1.52M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.52M
    if (_parent->nereids_id() == -1) {
122
774k
        return fmt::format("(id={})", _parent->node_id());
123
774k
    } else {
124
752k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
752k
    }
126
1.52M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
62.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
62.6k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
62.6k
    } else {
124
62.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
62.6k
    }
126
62.6k
}
_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
155k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
155k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
155k
    } else {
124
155k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
155k
    }
126
155k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
33
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
33
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
33
    } else {
124
33
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
33
    }
126
33
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.78k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.78k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.78k
    } else {
124
5.78k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.78k
    }
126
5.78k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.25k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.25k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
8.23k
    } else {
124
8.23k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.23k
    }
126
8.25k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
84.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
84.0k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
84.0k
    } else {
124
84.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
84.0k
    }
126
84.0k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
80.3k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
80.3k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
80.3k
    } else {
124
80.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
80.3k
    }
126
80.3k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
42
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
42
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
42
    } else {
124
42
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
42
    }
126
42
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
551k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
551k
    if (_parent->nereids_id() == -1) {
122
251k
        return fmt::format("(id={})", _parent->node_id());
123
300k
    } else {
124
300k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
300k
    }
126
551k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
50.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
50.4k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
50.4k
    } else {
124
50.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
50.4k
    }
126
50.4k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.29k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.29k
    if (_parent->nereids_id() == -1) {
122
4.29k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
4.29k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
464
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
464
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
362
    } else {
124
362
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
362
    }
126
464
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.15k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.15k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.13k
    } else {
124
5.13k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.13k
    }
126
5.15k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
518k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
518k
    if (_parent->nereids_id() == -1) {
122
518k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
518k
}
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.05M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.05M
    if (_parent->nereids_id() == -1) {
131
603k
        return fmt::format("(id={})", _parent->node_id());
132
603k
    } else {
133
450k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
450k
    }
135
1.05M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
110k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
110k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
110k
    } else {
133
110k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
110k
    }
135
110k
}
_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
156k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
156k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
156k
    } else {
133
156k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
156k
    }
135
156k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
40
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
40
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
40
    } else {
133
40
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
40
    }
135
40
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.78k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.78k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.78k
    } else {
133
5.78k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.78k
    }
135
5.78k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.26k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.26k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
8.25k
    } else {
133
8.25k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.25k
    }
135
8.26k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
84.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
84.5k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
84.4k
    } else {
133
84.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
84.4k
    }
135
84.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
80.1k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
80.1k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
80.1k
    } else {
133
80.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
80.1k
    }
135
80.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
52
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
52
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
52
    } else {
133
52
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
52
    }
135
52
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
12
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
12
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
3.90k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
3.90k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
3.90k
    } else {
133
3.90k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
3.90k
    }
135
3.90k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
464
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
464
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
362
    } else {
133
362
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
362
    }
135
464
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.5k
    if (_parent->nereids_id() == -1) {
131
12.5k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
191k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
191k
    if (_parent->nereids_id() == -1) {
131
191k
        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
191k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
398k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
399k
    if (_parent->nereids_id() == -1) {
131
399k
        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
398k
}
_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
31.2k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
31.2k
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
31.2k
    _terminated = true;
143
31.2k
    return Status::OK();
144
31.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3.27k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3.27k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3.27k
    _terminated = true;
143
3.27k
    return Status::OK();
144
3.27k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
6
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
6
    _terminated = true;
143
6
    return Status::OK();
144
6
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.94k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.94k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.94k
    _terminated = true;
143
1.94k
    return Status::OK();
144
1.94k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.03k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.03k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.03k
    _terminated = true;
143
1.03k
    return Status::OK();
144
1.03k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
492
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
492
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
491
    _terminated = true;
143
491
    return Status::OK();
144
492
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
32
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
32
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
32
    _terminated = true;
143
32
    return Status::OK();
144
32
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
6
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
6
    _terminated = true;
143
6
    return Status::OK();
144
6
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
202
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
202
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
202
    _terminated = true;
143
202
    return Status::OK();
144
202
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
20
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
20
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
20
    _terminated = true;
143
20
    return Status::OK();
144
20
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
121
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
121
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
121
    _terminated = true;
143
121
    return Status::OK();
144
121
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
129
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
129
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
129
    _terminated = true;
143
129
    return Status::OK();
144
129
}
145
146
269k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
269k
    return _child && _child->is_serial_operator() && !is_source()
148
269k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
269k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
269k
}
151
152
22.4k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
22.4k
    if (!_child) {
154
21.5k
        return false;
155
21.5k
    }
156
980
    if (_child->is_serial_operator()) {
157
87
        return true;
158
87
    }
159
893
    const auto child_distribution = _child->required_data_distribution(state);
160
893
    return child_distribution.need_local_exchange() &&
161
893
           !is_shuffled_exchange(child_distribution.distribution_type);
162
980
}
163
164
template <typename SharedStateArg>
165
18.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
18.6k
    fmt::memory_buffer debug_string_buffer;
167
18.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
18.6k
    return fmt::to_string(debug_string_buffer);
169
18.6k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
18.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
18.6k
    fmt::memory_buffer debug_string_buffer;
167
18.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
18.6k
    return fmt::to_string(debug_string_buffer);
169
18.6k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
18.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
18.6k
    fmt::memory_buffer debug_string_buffer;
174
18.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
18.6k
    return fmt::to_string(debug_string_buffer);
176
18.6k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
18.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
18.6k
    fmt::memory_buffer debug_string_buffer;
174
18.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
18.6k
    return fmt::to_string(debug_string_buffer);
176
18.6k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
18.7k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
18.7k
    fmt::memory_buffer debug_string_buffer;
180
18.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
18.7k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
18.7k
                   _is_serial_operator);
183
18.7k
    return fmt::to_string(debug_string_buffer);
184
18.7k
}
185
186
18.6k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
18.6k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
18.6k
}
189
190
579k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
579k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
579k
    _nereids_id = tnode.nereids_id;
193
579k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.21k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.21k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.21k
            tnode.intermediate_projections_list.size()) {
199
0
            return Status::InternalError(
200
0
                    "intermediate_output_tuple_id_list size:{} not match "
201
0
                    "intermediate_projections_list size:{}",
202
0
                    tnode.intermediate_output_tuple_id_list.size(),
203
0
                    tnode.intermediate_projections_list.size());
204
0
        }
205
3.21k
    }
206
579k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
579k
    _op_name = substr + "_OPERATOR";
208
209
579k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
579k
    } else if (tnode.__isset.conjuncts) {
212
252k
        for (const auto& conjunct : tnode.conjuncts) {
213
252k
            VExprContextSPtr context;
214
252k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
252k
            _conjuncts.emplace_back(context);
216
252k
        }
217
86.1k
    }
218
219
    // create the projections expr
220
579k
    if (tnode.__isset.projections) {
221
233k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
233k
    }
223
579k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.22k
        DCHECK(has_projection()) << "no final projections";
225
3.22k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
4.26k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
4.26k
            VExprContextSPtrs projections;
228
4.26k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
4.26k
            _projection->intermediate_projections.push_back(projections);
230
4.26k
        }
231
3.22k
    }
232
579k
    return Status::OK();
233
579k
}
234
235
606k
Status OperatorXBase::prepare(RuntimeState* state) {
236
606k
    for (auto& conjunct : _conjuncts) {
237
252k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
252k
    }
239
606k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
556k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
326k
            return a->execute_cost() < b->execute_cost();
242
326k
        });
243
556k
    };
244
245
606k
    if (has_projection()) {
246
233k
        auto& projection = *_projection;
247
237k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
4.26k
            const auto& input_row_desc =
249
4.26k
                    i == 0 ? operator_row_desc_before_projection()
250
4.26k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
4.26k
            RETURN_IF_ERROR(
252
4.26k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
4.26k
        }
254
233k
        const auto& final_projection_input_row_desc =
255
233k
                projection.intermediate_output_row_descriptors.empty()
256
233k
                        ? operator_row_desc_before_projection()
257
233k
                        : projection.intermediate_output_row_descriptors.back();
258
233k
        RETURN_IF_ERROR(
259
233k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
233k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
233k
                                                      projection.output_row_descriptor));
262
233k
    }
263
264
606k
    for (auto& conjunct : _conjuncts) {
265
252k
        RETURN_IF_ERROR(conjunct->open(state));
266
252k
    }
267
606k
    if (has_projection()) {
268
233k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
233k
        for (auto& projections : _projection->intermediate_projections) {
270
4.26k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
4.26k
        }
272
233k
    }
273
606k
    if (_child && !is_source()) {
274
86.4k
        RETURN_IF_ERROR(_child->prepare(state));
275
86.4k
    }
276
277
606k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
606k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
606k
    return Status::OK();
283
606k
}
284
285
7.98k
Status OperatorXBase::terminate(RuntimeState* state) {
286
7.98k
    if (_child && !is_source()) {
287
710
        RETURN_IF_ERROR(_child->terminate(state));
288
710
    }
289
7.98k
    auto result = state->get_local_state_result(operator_id());
290
7.98k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
7.98k
    return result.value()->terminate(state);
294
7.98k
}
295
296
4.21M
Status OperatorXBase::close(RuntimeState* state) {
297
4.21M
    if (_child && !is_source()) {
298
728k
        RETURN_IF_ERROR(_child->close(state));
299
728k
    }
300
4.21M
    auto result = state->get_local_state_result(operator_id());
301
4.21M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.21M
    return result.value()->close(state);
305
4.21M
}
306
307
256k
void PipelineXLocalStateBase::clear_origin_block() {
308
256k
    _origin_block.clear_column_data(
309
256k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
256k
}
311
312
743k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
743k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
743k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
743k
    return Status::OK();
317
743k
}
318
319
0
bool PipelineXLocalStateBase::is_blockable() const {
320
0
    return std::any_of(_projections.begin(), _projections.end(),
321
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
322
0
}
323
324
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
325
257k
                                     Block* output_block) const {
326
257k
    auto* local_state = state->get_local_state(operator_id());
327
257k
    SCOPED_TIMER(local_state->exec_time_counter());
328
257k
    SCOPED_TIMER(local_state->_projection_timer);
329
257k
    const size_t rows = origin_block->rows();
330
257k
    if (rows == 0) {
331
139k
        return Status::OK();
332
139k
    }
333
117k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
117k
    {
336
117k
        Block input_block = *origin_block;
337
338
117k
        ColumnsWithTypeAndName new_columns;
339
117k
        for (const auto& projections : local_state->_intermediate_projections) {
340
1.52k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
1.52k
            new_columns.resize(projections.size());
345
9.11k
            for (int i = 0; i < projections.size(); i++) {
346
7.59k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
7.59k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
7.59k
            }
355
1.52k
            Block tmp_block {new_columns};
356
1.52k
            input_block.swap(tmp_block);
357
1.52k
        }
358
359
117k
        if (input_block.rows() != rows) {
360
0
            return Status::InternalError(
361
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
362
0
                    "input_block: {}",
363
0
                    input_block.rows(), rows, input_block.dump_structure());
364
0
        }
365
366
117k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
117k
                output_block, _projection->output_row_descriptor);
368
117k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
117k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
117k
        Columns shared_columns(mutable_columns.size());
371
372
661k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
543k
            ColumnPtr column_ptr;
374
543k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
543k
            if (column_ptr->size() != rows) {
376
0
                return Status::InternalError(
377
0
                        "projection result column size {} not equal input rows {}, expr: {}",
378
0
                        column_ptr->size(), rows,
379
0
                        local_state->_projections[i]->root()->debug_string());
380
0
            }
381
543k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
543k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
543k
            if (column_ptr->is_exclusive()) {
386
195k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
347k
            } else {
388
347k
                shared_columns[i] = std::move(column_ptr);
389
347k
            }
390
543k
        }
391
392
117k
        scoped_mutable_block.restore();
393
661k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
543k
            if (shared_columns[i]) {
395
347k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
347k
            }
397
543k
        }
398
117k
    }
399
400
0
    origin_block->clear_column_data(
401
117k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
117k
    DCHECK_EQ(output_block->rows(), rows);
403
404
117k
    return Status::OK();
405
117k
}
406
407
4.04M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.04M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.04M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.04M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.04M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.04M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.04M
            if (_debug_point_count++ % 2 == 0) {
414
4.04M
                return Status::OK();
415
4.04M
            }
416
4.04M
        }
417
4.04M
    });
418
419
4.04M
    Status status;
420
4.04M
    auto* local_state = state->get_local_state(operator_id());
421
4.04M
    Defer defer([&]() {
422
4.04M
        if (status.ok()) {
423
4.04M
            local_state->update_output_block_counters(*block);
424
4.04M
        }
425
4.04M
    });
426
4.04M
    if (has_projection()) {
427
256k
        local_state->clear_origin_block();
428
256k
        status = get_block(state, &local_state->_origin_block, eos);
429
256k
        if (UNLIKELY(!status.ok())) {
430
24
            return status;
431
24
        }
432
256k
        status = do_projections(state, &local_state->_origin_block, block);
433
256k
        return status;
434
256k
    }
435
3.79M
    status = get_block(state, block, eos);
436
3.79M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.79M
    return status;
438
3.79M
}
439
440
2.45M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.45M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
3.48k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
3.48k
        *eos = true;
444
3.48k
    }
445
446
2.45M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.45M
        auto op_name = to_lower(_parent->_op_name);
448
2.45M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.45M
        arg_op_name = to_lower(arg_op_name);
450
451
2.45M
        if (op_name == arg_op_name) {
452
2.45M
            *eos = true;
453
2.45M
        }
454
2.45M
    });
455
456
2.45M
    if (auto rows = block->rows()) {
457
654k
        _num_rows_returned += rows;
458
654k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
654k
    }
460
2.45M
}
461
462
31.2k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
31.2k
    auto result = state->get_sink_local_state_result();
464
31.2k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
31.2k
    return result.value()->terminate(state);
468
31.2k
}
469
470
18.6k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
18.6k
    fmt::memory_buffer debug_string_buffer;
472
473
18.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
18.6k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
18.6k
    return fmt::to_string(debug_string_buffer);
476
18.6k
}
477
478
18.6k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
18.6k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
18.6k
}
481
482
307k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
307k
    std::string op_name = "UNKNOWN_SINK";
484
307k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
308k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
308k
        op_name = it->second;
488
308k
    }
489
307k
    _name = op_name + "_OPERATOR";
490
307k
    return Status::OK();
491
307k
}
492
493
258k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
258k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
258k
    _nereids_id = tnode.nereids_id;
496
258k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
258k
    _name = substr + "_SINK_OPERATOR";
498
258k
    return Status::OK();
499
258k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.47M
                                                            LocalSinkStateInfo& info) {
504
1.47M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.47M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.47M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.47M
    return Status::OK();
508
1.47M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
110k
                                                            LocalSinkStateInfo& info) {
504
110k
    auto local_state = LocalStateType::create_unique(this, state);
505
110k
    RETURN_IF_ERROR(local_state->init(state, info));
506
110k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
110k
    return Status::OK();
508
110k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
358k
                                                            LocalSinkStateInfo& info) {
504
358k
    auto local_state = LocalStateType::create_unique(this, state);
505
358k
    RETURN_IF_ERROR(local_state->init(state, info));
506
358k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
358k
    return Status::OK();
508
358k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
3
                                                            LocalSinkStateInfo& info) {
504
3
    auto local_state = LocalStateType::create_unique(this, state);
505
3
    RETURN_IF_ERROR(local_state->init(state, info));
506
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
3
    return Status::OK();
508
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
355
                                                            LocalSinkStateInfo& info) {
504
355
    auto local_state = LocalStateType::create_unique(this, state);
505
355
    RETURN_IF_ERROR(local_state->init(state, info));
506
355
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
355
    return Status::OK();
508
355
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
42.7k
                                                            LocalSinkStateInfo& info) {
504
42.7k
    auto local_state = LocalStateType::create_unique(this, state);
505
42.7k
    RETURN_IF_ERROR(local_state->init(state, info));
506
42.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
42.7k
    return Status::OK();
508
42.7k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.26k
                                                            LocalSinkStateInfo& info) {
504
8.26k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.26k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.26k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.26k
    return Status::OK();
508
8.26k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
9
                                                            LocalSinkStateInfo& info) {
504
9
    auto local_state = LocalStateType::create_unique(this, state);
505
9
    RETURN_IF_ERROR(local_state->init(state, info));
506
9
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9
    return Status::OK();
508
9
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
156k
                                                            LocalSinkStateInfo& info) {
504
156k
    auto local_state = LocalStateType::create_unique(this, state);
505
156k
    RETURN_IF_ERROR(local_state->init(state, info));
506
156k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
156k
    return Status::OK();
508
156k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
40
                                                            LocalSinkStateInfo& info) {
504
40
    auto local_state = LocalStateType::create_unique(this, state);
505
40
    RETURN_IF_ERROR(local_state->init(state, info));
506
40
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
40
    return Status::OK();
508
40
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
191k
                                                            LocalSinkStateInfo& info) {
504
191k
    auto local_state = LocalStateType::create_unique(this, state);
505
191k
    RETURN_IF_ERROR(local_state->init(state, info));
506
191k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
191k
    return Status::OK();
508
191k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
84.6k
                                                            LocalSinkStateInfo& info) {
504
84.6k
    auto local_state = LocalStateType::create_unique(this, state);
505
84.6k
    RETURN_IF_ERROR(local_state->init(state, info));
506
84.6k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
84.6k
    return Status::OK();
508
84.6k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
80.1k
                                                            LocalSinkStateInfo& info) {
504
80.1k
    auto local_state = LocalStateType::create_unique(this, state);
505
80.1k
    RETURN_IF_ERROR(local_state->init(state, info));
506
80.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
80.1k
    return Status::OK();
508
80.1k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
52
                                                            LocalSinkStateInfo& info) {
504
52
    auto local_state = LocalStateType::create_unique(this, state);
505
52
    RETURN_IF_ERROR(local_state->init(state, info));
506
52
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
52
    return Status::OK();
508
52
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
414k
                                                            LocalSinkStateInfo& info) {
504
414k
    auto local_state = LocalStateType::create_unique(this, state);
505
414k
    RETURN_IF_ERROR(local_state->init(state, info));
506
414k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
414k
    return Status::OK();
508
414k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.78k
                                                            LocalSinkStateInfo& info) {
504
5.78k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.78k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.78k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.78k
    return Status::OK();
508
5.78k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
3.90k
                                                            LocalSinkStateInfo& info) {
504
3.90k
    auto local_state = LocalStateType::create_unique(this, state);
505
3.90k
    RETURN_IF_ERROR(local_state->init(state, info));
506
3.90k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
3.90k
    return Status::OK();
508
3.90k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1.69k
                                                            LocalSinkStateInfo& info) {
504
1.69k
    auto local_state = LocalStateType::create_unique(this, state);
505
1.69k
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.69k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.69k
    return Status::OK();
508
1.69k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
362
                                                            LocalSinkStateInfo& info) {
504
362
    auto local_state = LocalStateType::create_unique(this, state);
505
362
    RETURN_IF_ERROR(local_state->init(state, info));
506
362
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
362
    return Status::OK();
508
362
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.80k
                                                            LocalSinkStateInfo& info) {
504
4.80k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.80k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.80k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.80k
    return Status::OK();
508
4.80k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.55k
                                                            LocalSinkStateInfo& info) {
504
2.55k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.55k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.55k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.55k
    return Status::OK();
508
2.55k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.61k
                                                            LocalSinkStateInfo& info) {
504
2.61k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.61k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.61k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.61k
    return Status::OK();
508
2.61k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.48k
                                                            LocalSinkStateInfo& info) {
504
2.48k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.48k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.48k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.48k
    return Status::OK();
508
2.48k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
565
                                                            LocalSinkStateInfo& info) {
504
565
    auto local_state = LocalStateType::create_unique(this, state);
505
565
    RETURN_IF_ERROR(local_state->init(state, info));
506
565
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
565
    return Status::OK();
508
565
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
71
                                                            LocalSinkStateInfo& info) {
504
71
    auto local_state = LocalStateType::create_unique(this, state);
505
71
    RETURN_IF_ERROR(local_state->init(state, info));
506
71
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
71
    return Status::OK();
508
71
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
509
510
template <typename LocalStateType>
511
1.17M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
0
                                 LocalExchangeSharedState>) {
514
0
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
0
                                        MultiCastSharedState>) {
517
0
        throw Exception(Status::FatalError("should not reach here!"));
518
1.17M
    } else {
519
1.17M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.17M
        ss->id = operator_id();
521
1.17M
        for (auto& dest : dests_id()) {
522
1.17M
            ss->related_op_ids.insert(dest);
523
1.17M
        }
524
1.17M
        return ss;
525
1.17M
    }
526
1.17M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
98.3k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
98.3k
    } else {
519
98.3k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
98.3k
        ss->id = operator_id();
521
98.3k
        for (auto& dest : dests_id()) {
522
98.2k
            ss->related_op_ids.insert(dest);
523
98.2k
        }
524
98.3k
        return ss;
525
98.3k
    }
526
98.3k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
359k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
359k
    } else {
519
359k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
359k
        ss->id = operator_id();
521
359k
        for (auto& dest : dests_id()) {
522
355k
            ss->related_op_ids.insert(dest);
523
355k
        }
524
359k
        return ss;
525
359k
    }
526
359k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
3
    } else {
519
3
        auto ss = LocalStateType::SharedStateType::create_shared();
520
3
        ss->id = operator_id();
521
3
        for (auto& dest : dests_id()) {
522
3
            ss->related_op_ids.insert(dest);
523
3
        }
524
3
        return ss;
525
3
    }
526
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
355
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
355
    } else {
519
355
        auto ss = LocalStateType::SharedStateType::create_shared();
520
355
        ss->id = operator_id();
521
355
        for (auto& dest : dests_id()) {
522
354
            ss->related_op_ids.insert(dest);
523
354
        }
524
355
        return ss;
525
355
    }
526
355
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
42.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
42.8k
    } else {
519
42.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
42.8k
        ss->id = operator_id();
521
42.8k
        for (auto& dest : dests_id()) {
522
42.4k
            ss->related_op_ids.insert(dest);
523
42.4k
        }
524
42.8k
        return ss;
525
42.8k
    }
526
42.8k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
8.29k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8.29k
    } else {
519
8.29k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.29k
        ss->id = operator_id();
521
8.29k
        for (auto& dest : dests_id()) {
522
8.29k
            ss->related_op_ids.insert(dest);
523
8.29k
        }
524
8.29k
        return ss;
525
8.29k
    }
526
8.29k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
9
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
9
    } else {
519
9
        auto ss = LocalStateType::SharedStateType::create_shared();
520
9
        ss->id = operator_id();
521
9
        for (auto& dest : dests_id()) {
522
9
            ss->related_op_ids.insert(dest);
523
9
        }
524
9
        return ss;
525
9
    }
526
9
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
157k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
157k
    } else {
519
157k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
157k
        ss->id = operator_id();
521
157k
        for (auto& dest : dests_id()) {
522
157k
            ss->related_op_ids.insert(dest);
523
157k
        }
524
157k
        return ss;
525
157k
    }
526
157k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
42
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
42
    } else {
519
42
        auto ss = LocalStateType::SharedStateType::create_shared();
520
42
        ss->id = operator_id();
521
42
        for (auto& dest : dests_id()) {
522
42
            ss->related_op_ids.insert(dest);
523
42
        }
524
42
        return ss;
525
42
    }
526
42
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
84.9k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
84.9k
    } else {
519
84.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
84.9k
        ss->id = operator_id();
521
85.0k
        for (auto& dest : dests_id()) {
522
85.0k
            ss->related_op_ids.insert(dest);
523
85.0k
        }
524
84.9k
        return ss;
525
84.9k
    }
526
84.9k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
51
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
51
    } else {
519
51
        auto ss = LocalStateType::SharedStateType::create_shared();
520
51
        ss->id = operator_id();
521
51
        for (auto& dest : dests_id()) {
522
51
            ss->related_op_ids.insert(dest);
523
51
        }
524
51
        return ss;
525
51
    }
526
51
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
416k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
416k
    } else {
519
416k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
416k
        ss->id = operator_id();
521
416k
        for (auto& dest : dests_id()) {
522
411k
            ss->related_op_ids.insert(dest);
523
411k
        }
524
416k
        return ss;
525
416k
    }
526
416k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
5.80k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
5.80k
    } else {
519
5.80k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
5.80k
        ss->id = operator_id();
521
5.80k
        for (auto& dest : dests_id()) {
522
5.80k
            ss->related_op_ids.insert(dest);
523
5.80k
        }
524
5.80k
        return ss;
525
5.80k
    }
526
5.80k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
464
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
464
    } else {
519
464
        auto ss = LocalStateType::SharedStateType::create_shared();
520
464
        ss->id = operator_id();
521
464
        for (auto& dest : dests_id()) {
522
464
            ss->related_op_ids.insert(dest);
523
464
        }
524
464
        return ss;
525
464
    }
526
464
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.61k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.61k
    } else {
519
2.61k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.61k
        ss->id = operator_id();
521
2.61k
        for (auto& dest : dests_id()) {
522
2.61k
            ss->related_op_ids.insert(dest);
523
2.61k
        }
524
2.61k
        return ss;
525
2.61k
    }
526
2.61k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.48k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.48k
    } else {
519
2.48k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.48k
        ss->id = operator_id();
521
2.48k
        for (auto& dest : dests_id()) {
522
2.48k
            ss->related_op_ids.insert(dest);
523
2.48k
        }
524
2.48k
        return ss;
525
2.48k
    }
526
2.48k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
563
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
563
    } else {
519
563
        auto ss = LocalStateType::SharedStateType::create_shared();
520
563
        ss->id = operator_id();
521
563
        for (auto& dest : dests_id()) {
522
553
            ss->related_op_ids.insert(dest);
523
553
        }
524
563
        return ss;
525
563
    }
526
563
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
71
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
71
    } else {
519
71
        auto ss = LocalStateType::SharedStateType::create_shared();
520
71
        ss->id = operator_id();
521
71
        for (auto& dest : dests_id()) {
522
71
            ss->related_op_ids.insert(dest);
523
71
        }
524
71
        return ss;
525
71
    }
526
71
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.76M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.76M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.76M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.76M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.76M
    return Status::OK();
534
1.76M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
62.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
62.7k
    auto local_state = LocalStateType::create_unique(state, this);
531
62.7k
    RETURN_IF_ERROR(local_state->init(state, info));
532
62.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
62.7k
    return Status::OK();
534
62.7k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
227k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
227k
    auto local_state = LocalStateType::create_unique(state, this);
531
227k
    RETURN_IF_ERROR(local_state->init(state, info));
532
227k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
227k
    return Status::OK();
534
227k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
125
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
125
    auto local_state = LocalStateType::create_unique(state, this);
531
125
    RETURN_IF_ERROR(local_state->init(state, info));
532
125
    state->emplace_local_state(operator_id(), std::move(local_state));
533
125
    return Status::OK();
534
125
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.26k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.26k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.26k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.26k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.26k
    return Status::OK();
534
8.26k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.17k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.17k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.17k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.17k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.17k
    return Status::OK();
534
8.17k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
33
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
33
    auto local_state = LocalStateType::create_unique(state, this);
531
33
    RETURN_IF_ERROR(local_state->init(state, info));
532
33
    state->emplace_local_state(operator_id(), std::move(local_state));
533
33
    return Status::OK();
534
33
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
148k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
148k
    auto local_state = LocalStateType::create_unique(state, this);
531
148k
    RETURN_IF_ERROR(local_state->init(state, info));
532
148k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
148k
    return Status::OK();
534
148k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
84.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
84.5k
    auto local_state = LocalStateType::create_unique(state, this);
531
84.5k
    RETURN_IF_ERROR(local_state->init(state, info));
532
84.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
84.5k
    return Status::OK();
534
84.5k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
80.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
80.5k
    auto local_state = LocalStateType::create_unique(state, this);
531
80.5k
    RETURN_IF_ERROR(local_state->init(state, info));
532
80.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
80.5k
    return Status::OK();
534
80.5k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
42
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
42
    auto local_state = LocalStateType::create_unique(state, this);
531
42
    RETURN_IF_ERROR(local_state->init(state, info));
532
42
    state->emplace_local_state(operator_id(), std::move(local_state));
533
42
    return Status::OK();
534
42
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.76k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.76k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.76k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.76k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.76k
    return Status::OK();
534
3.76k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
254k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
254k
    auto local_state = LocalStateType::create_unique(state, this);
531
254k
    RETURN_IF_ERROR(local_state->init(state, info));
532
254k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
254k
    return Status::OK();
534
254k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.45k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.45k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.45k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.45k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.45k
    return Status::OK();
534
1.45k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.76k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.76k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.76k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.76k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.76k
    return Status::OK();
534
5.76k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
27
    auto local_state = LocalStateType::create_unique(state, this);
531
27
    RETURN_IF_ERROR(local_state->init(state, info));
532
27
    state->emplace_local_state(operator_id(), std::move(local_state));
533
27
    return Status::OK();
534
27
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.52k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.52k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.52k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.52k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.52k
    return Status::OK();
534
1.52k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
50.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
50.4k
    auto local_state = LocalStateType::create_unique(state, this);
531
50.4k
    RETURN_IF_ERROR(local_state->init(state, info));
532
50.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
50.4k
    return Status::OK();
534
50.4k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.29k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.29k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.29k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.29k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.29k
    return Status::OK();
534
4.29k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
362
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
362
    auto local_state = LocalStateType::create_unique(state, this);
531
362
    RETURN_IF_ERROR(local_state->init(state, info));
532
362
    state->emplace_local_state(operator_id(), std::move(local_state));
533
362
    return Status::OK();
534
362
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.64k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.64k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.64k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.64k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.64k
    return Status::OK();
534
2.64k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.51k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.51k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.51k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.51k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.51k
    return Status::OK();
534
2.51k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
311
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
311
    auto local_state = LocalStateType::create_unique(state, this);
531
311
    RETURN_IF_ERROR(local_state->init(state, info));
532
311
    state->emplace_local_state(operator_id(), std::move(local_state));
533
311
    return Status::OK();
534
311
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.57k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.57k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.57k
    return Status::OK();
534
1.57k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.32k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.32k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.32k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.32k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.32k
    return Status::OK();
534
4.32k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
520k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
520k
    auto local_state = LocalStateType::create_unique(state, this);
531
520k
    RETURN_IF_ERROR(local_state->init(state, info));
532
520k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
520k
    return Status::OK();
534
520k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
14
    auto local_state = LocalStateType::create_unique(state, this);
531
14
    RETURN_IF_ERROR(local_state->init(state, info));
532
14
    state->emplace_local_state(operator_id(), std::move(local_state));
533
14
    return Status::OK();
534
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
164
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
164
    auto local_state = LocalStateType::create_unique(state, this);
531
164
    RETURN_IF_ERROR(local_state->init(state, info));
532
164
    state->emplace_local_state(operator_id(), std::move(local_state));
533
164
    return Status::OK();
534
164
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.18k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.18k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.18k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.18k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.18k
    return Status::OK();
534
2.18k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
779
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
779
    auto local_state = LocalStateType::create_unique(state, this);
531
779
    RETURN_IF_ERROR(local_state->init(state, info));
532
779
    state->emplace_local_state(operator_id(), std::move(local_state));
533
779
    return Status::OK();
534
779
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
824
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
824
    auto local_state = LocalStateType::create_unique(state, this);
531
824
    RETURN_IF_ERROR(local_state->init(state, info));
532
824
    state->emplace_local_state(operator_id(), std::move(local_state));
533
824
    return Status::OK();
534
824
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.96k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.96k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.96k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.96k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.96k
    return Status::OK();
534
5.96k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
279k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
279k
    auto local_state = LocalStateType::create_unique(state, this);
531
279k
    RETURN_IF_ERROR(local_state->init(state, info));
532
279k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
279k
    return Status::OK();
534
279k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.47M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.75M
        : _num_rows_returned(0),
542
1.75M
          _rows_returned_counter(nullptr),
543
1.75M
          _parent(parent),
544
1.75M
          _state(state),
545
1.75M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.76M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.76M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.76M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.76M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.76M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1.76M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.76M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.76M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.76M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.76M
    if constexpr (!is_fake_shared) {
560
983k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
609k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
609k
                                    .first.get()
563
609k
                                    ->template cast<SharedStateArg>();
564
565
609k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
609k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
609k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
609k
        } else if (info.shared_state) {
569
311k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
311k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
311k
            _dependency = _shared_state->create_source_dependency(
576
311k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
311k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
311k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
311k
        } else {
580
61.7k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
6.50k
                DCHECK(false);
582
6.50k
            }
583
61.7k
        }
584
983k
    }
585
586
1.76M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1.76M
    _rows_returned_counter =
591
1.76M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.76M
    _blocks_returned_counter =
593
1.76M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.76M
    _output_block_bytes_counter =
595
1.76M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.76M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.76M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.76M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.76M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.76M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.76M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.76M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.76M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.76M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.76M
    _memory_used_counter =
606
1.76M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.76M
    _common_profile->add_info_string("IsColocate",
608
1.76M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.76M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.76M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.76M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.76M
    return Status::OK();
613
1.76M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
62.9k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
62.9k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
62.9k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
62.9k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
62.9k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
62.9k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
62.9k
    _operator_profile->add_child(_common_profile.get(), true);
557
62.9k
    _operator_profile->add_child(_custom_profile.get(), true);
558
62.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
62.9k
    if constexpr (!is_fake_shared) {
560
62.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
12.4k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
12.4k
                                    .first.get()
563
12.4k
                                    ->template cast<SharedStateArg>();
564
565
12.4k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
12.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
12.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
50.4k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
49.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
49.8k
            _dependency = _shared_state->create_source_dependency(
576
49.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
49.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
49.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
49.8k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
616
        }
584
62.9k
    }
585
586
62.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
62.9k
    _rows_returned_counter =
591
62.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
62.9k
    _blocks_returned_counter =
593
62.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
62.9k
    _output_block_bytes_counter =
595
62.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
62.9k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
62.9k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
62.9k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
62.9k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
62.9k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
62.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
62.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
62.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
62.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
62.9k
    _memory_used_counter =
606
62.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
62.9k
    _common_profile->add_info_string("IsColocate",
608
62.9k
                                     std::to_string(_parent->is_colocated_operator()));
609
62.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
62.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
62.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
62.9k
    return Status::OK();
613
62.9k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1
    _operator_profile->add_child(_common_profile.get(), true);
557
1
    _operator_profile->add_child(_custom_profile.get(), true);
558
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1
    if constexpr (!is_fake_shared) {
560
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
1
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1
            _dependency = _shared_state->create_source_dependency(
576
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
1
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
1
    }
585
586
1
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1
    _rows_returned_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1
    _blocks_returned_counter =
593
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1
    _output_block_bytes_counter =
595
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1
    _memory_used_counter =
606
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1
    _common_profile->add_info_string("IsColocate",
608
1
                                     std::to_string(_parent->is_colocated_operator()));
609
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1
    return Status::OK();
613
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
157k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
157k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
157k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
157k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
157k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
157k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
157k
    _operator_profile->add_child(_common_profile.get(), true);
557
157k
    _operator_profile->add_child(_custom_profile.get(), true);
558
157k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
157k
    if constexpr (!is_fake_shared) {
560
157k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
157k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
152k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
152k
            _dependency = _shared_state->create_source_dependency(
576
152k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
152k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
152k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
152k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
4.08k
        }
584
157k
    }
585
586
157k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
157k
    _rows_returned_counter =
591
157k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
157k
    _blocks_returned_counter =
593
157k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
157k
    _output_block_bytes_counter =
595
157k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
157k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
157k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
157k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
157k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
157k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
157k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
157k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
157k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
157k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
157k
    _memory_used_counter =
606
157k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
157k
    _common_profile->add_info_string("IsColocate",
608
157k
                                     std::to_string(_parent->is_colocated_operator()));
609
157k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
157k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
157k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
157k
    return Status::OK();
613
157k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
33
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
33
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
33
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
33
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
33
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
33
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
33
    _operator_profile->add_child(_common_profile.get(), true);
557
33
    _operator_profile->add_child(_custom_profile.get(), true);
558
33
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
33
    if constexpr (!is_fake_shared) {
560
33
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
33
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
33
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
33
            _dependency = _shared_state->create_source_dependency(
576
33
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
33
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
33
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
33
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
33
    }
585
586
33
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
33
    _rows_returned_counter =
591
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
33
    _blocks_returned_counter =
593
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
33
    _output_block_bytes_counter =
595
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
33
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
33
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
33
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
33
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
33
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
33
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
33
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
33
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
33
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
33
    _memory_used_counter =
606
33
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
33
    _common_profile->add_info_string("IsColocate",
608
33
                                     std::to_string(_parent->is_colocated_operator()));
609
33
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
33
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
33
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
33
    return Status::OK();
613
33
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.80k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.80k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.80k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.80k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.80k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.80k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.80k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.80k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.80k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.80k
    if constexpr (!is_fake_shared) {
560
5.80k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.80k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.74k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.74k
            _dependency = _shared_state->create_source_dependency(
576
5.74k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.74k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.74k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.74k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
65
        }
584
5.80k
    }
585
586
5.80k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.80k
    _rows_returned_counter =
591
5.80k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.80k
    _blocks_returned_counter =
593
5.80k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.80k
    _output_block_bytes_counter =
595
5.80k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.80k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.80k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.80k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.80k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.80k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.80k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.80k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.80k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.80k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.80k
    _memory_used_counter =
606
5.80k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.80k
    _common_profile->add_info_string("IsColocate",
608
5.80k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.80k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.80k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.80k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.80k
    return Status::OK();
613
5.80k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.29k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.29k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.29k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.29k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.29k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
8.29k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.29k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.29k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.29k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.29k
    if constexpr (!is_fake_shared) {
560
8.29k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
8.29k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
8.25k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.25k
            _dependency = _shared_state->create_source_dependency(
576
8.25k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.25k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.25k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.25k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
46
        }
584
8.29k
    }
585
586
8.29k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
8.29k
    _rows_returned_counter =
591
8.29k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.29k
    _blocks_returned_counter =
593
8.29k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.29k
    _output_block_bytes_counter =
595
8.29k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.29k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.29k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.29k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.29k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.29k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.29k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.29k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.29k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.29k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.29k
    _memory_used_counter =
606
8.29k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.29k
    _common_profile->add_info_string("IsColocate",
608
8.29k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.29k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.29k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.29k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.29k
    return Status::OK();
613
8.29k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
84.9k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
84.9k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
84.9k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
84.9k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
84.9k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
84.9k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
84.9k
    _operator_profile->add_child(_common_profile.get(), true);
557
84.9k
    _operator_profile->add_child(_custom_profile.get(), true);
558
84.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
84.9k
    if constexpr (!is_fake_shared) {
560
84.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
84.9k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
83.1k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
83.1k
            _dependency = _shared_state->create_source_dependency(
576
83.1k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
83.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
83.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
83.1k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.78k
        }
584
84.9k
    }
585
586
84.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
84.9k
    _rows_returned_counter =
591
84.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
84.9k
    _blocks_returned_counter =
593
84.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
84.9k
    _output_block_bytes_counter =
595
84.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
84.9k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
84.9k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
84.9k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
84.9k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
84.9k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
84.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
84.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
84.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
84.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
84.9k
    _memory_used_counter =
606
84.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
84.9k
    _common_profile->add_info_string("IsColocate",
608
84.9k
                                     std::to_string(_parent->is_colocated_operator()));
609
84.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
84.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
84.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
84.9k
    return Status::OK();
613
84.9k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
80.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
80.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
80.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
80.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
80.5k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
80.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
80.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
80.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
80.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
80.5k
    if constexpr (!is_fake_shared) {
560
80.5k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
80.4k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
80.4k
                                    .first.get()
563
80.4k
                                    ->template cast<SharedStateArg>();
564
565
80.4k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
80.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
80.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
80.4k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
89
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
89
        }
584
80.5k
    }
585
586
80.5k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
80.5k
    _rows_returned_counter =
591
80.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
80.5k
    _blocks_returned_counter =
593
80.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
80.5k
    _output_block_bytes_counter =
595
80.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
80.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
80.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
80.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
80.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
80.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
80.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
80.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
80.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
80.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
80.5k
    _memory_used_counter =
606
80.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
80.5k
    _common_profile->add_info_string("IsColocate",
608
80.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
80.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
80.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
80.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
80.5k
    return Status::OK();
613
80.5k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
42
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
42
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
42
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
42
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
42
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
42
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
42
    _operator_profile->add_child(_common_profile.get(), true);
557
42
    _operator_profile->add_child(_custom_profile.get(), true);
558
42
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
42
    if constexpr (!is_fake_shared) {
560
42
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
42
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
42
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
42
            _dependency = _shared_state->create_source_dependency(
576
42
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
42
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
42
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
42
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
42
    }
585
586
42
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
42
    _rows_returned_counter =
591
42
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
42
    _blocks_returned_counter =
593
42
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
42
    _output_block_bytes_counter =
595
42
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
42
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
42
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
42
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
42
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
42
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
42
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
42
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
42
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
42
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
42
    _memory_used_counter =
606
42
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
42
    _common_profile->add_info_string("IsColocate",
608
42
                                     std::to_string(_parent->is_colocated_operator()));
609
42
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
42
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
42
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
42
    return Status::OK();
613
42
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
784k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
784k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
784k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
784k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
784k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
784k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
784k
    _operator_profile->add_child(_common_profile.get(), true);
557
784k
    _operator_profile->add_child(_custom_profile.get(), true);
558
784k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
    if constexpr (!is_fake_shared) {
560
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
                                    .first.get()
563
                                    ->template cast<SharedStateArg>();
564
565
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
            _dependency = _shared_state->create_source_dependency(
576
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
        }
584
    }
585
586
784k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
784k
    _rows_returned_counter =
591
784k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
784k
    _blocks_returned_counter =
593
784k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
784k
    _output_block_bytes_counter =
595
784k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
784k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
784k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
784k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
784k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
784k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
784k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
784k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
784k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
784k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
784k
    _memory_used_counter =
606
784k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
784k
    _common_profile->add_info_string("IsColocate",
608
784k
                                     std::to_string(_parent->is_colocated_operator()));
609
784k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
784k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
784k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
784k
    return Status::OK();
613
784k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
50.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
50.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
50.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
50.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
50.3k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
50.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
50.3k
    _operator_profile->add_child(_common_profile.get(), true);
557
50.3k
    _operator_profile->add_child(_custom_profile.get(), true);
558
50.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
50.3k
    if constexpr (!is_fake_shared) {
560
50.3k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
50.3k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1.90k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1.90k
            _dependency = _shared_state->create_source_dependency(
576
1.90k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1.90k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1.90k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
48.4k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
48.4k
        }
584
50.3k
    }
585
586
50.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
50.3k
    _rows_returned_counter =
591
50.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
50.3k
    _blocks_returned_counter =
593
50.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
50.3k
    _output_block_bytes_counter =
595
50.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
50.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
50.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
50.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
50.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
50.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
50.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
50.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
50.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
50.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
50.3k
    _memory_used_counter =
606
50.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
50.3k
    _common_profile->add_info_string("IsColocate",
608
50.3k
                                     std::to_string(_parent->is_colocated_operator()));
609
50.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
50.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
50.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
50.3k
    return Status::OK();
613
50.3k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
4.31k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
4.31k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
4.31k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
4.31k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
4.31k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
4.31k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
4.31k
    _operator_profile->add_child(_common_profile.get(), true);
557
4.31k
    _operator_profile->add_child(_custom_profile.get(), true);
558
4.31k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
4.31k
    if constexpr (!is_fake_shared) {
560
4.31k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
4.31k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.24k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.24k
            _dependency = _shared_state->create_source_dependency(
576
4.24k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.24k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.24k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.24k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
70
        }
584
4.31k
    }
585
586
4.31k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
4.31k
    _rows_returned_counter =
591
4.31k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
4.31k
    _blocks_returned_counter =
593
4.31k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
4.31k
    _output_block_bytes_counter =
595
4.31k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
4.31k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
4.31k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
4.31k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
4.31k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
4.31k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
4.31k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
4.31k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
4.31k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
4.31k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
4.31k
    _memory_used_counter =
606
4.31k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
4.31k
    _common_profile->add_info_string("IsColocate",
608
4.31k
                                     std::to_string(_parent->is_colocated_operator()));
609
4.31k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
4.31k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
4.31k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
4.31k
    return Status::OK();
613
4.31k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
464
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
464
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
464
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
464
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
464
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
464
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
464
    _operator_profile->add_child(_common_profile.get(), true);
557
464
    _operator_profile->add_child(_custom_profile.get(), true);
558
464
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
464
    if constexpr (!is_fake_shared) {
560
464
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
464
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
464
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
464
            _dependency = _shared_state->create_source_dependency(
576
464
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
464
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
464
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
464
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
464
    }
585
586
464
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
464
    _rows_returned_counter =
591
464
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
464
    _blocks_returned_counter =
593
464
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
464
    _output_block_bytes_counter =
595
464
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
464
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
464
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
464
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
464
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
464
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
464
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
464
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
464
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
464
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
464
    _memory_used_counter =
606
464
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
464
    _common_profile->add_info_string("IsColocate",
608
464
                                     std::to_string(_parent->is_colocated_operator()));
609
464
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
464
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
464
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
464
    return Status::OK();
613
464
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.17k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.17k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.17k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.17k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.17k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.17k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.17k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.17k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.17k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.17k
    if constexpr (!is_fake_shared) {
560
5.17k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.17k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.14k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.14k
            _dependency = _shared_state->create_source_dependency(
576
5.14k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.14k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.14k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.14k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
36
        }
584
5.17k
    }
585
586
5.17k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.17k
    _rows_returned_counter =
591
5.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.17k
    _blocks_returned_counter =
593
5.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.17k
    _output_block_bytes_counter =
595
5.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.17k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.17k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.17k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.17k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.17k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.17k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.17k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.17k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.17k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.17k
    _memory_used_counter =
606
5.17k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.17k
    _common_profile->add_info_string("IsColocate",
608
5.17k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.17k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.17k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.17k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.17k
    return Status::OK();
613
5.17k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
523k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
523k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
523k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
523k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
523k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
523k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
523k
    _operator_profile->add_child(_common_profile.get(), true);
557
523k
    _operator_profile->add_child(_custom_profile.get(), true);
558
523k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
523k
    if constexpr (!is_fake_shared) {
560
523k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
516k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
516k
                                    .first.get()
563
516k
                                    ->template cast<SharedStateArg>();
564
565
516k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
516k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
516k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
516k
        } else if (info.shared_state) {
569
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.50k
        } else {
580
6.50k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
6.50k
                DCHECK(false);
582
6.50k
            }
583
6.50k
        }
584
523k
    }
585
586
523k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
523k
    _rows_returned_counter =
591
523k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
523k
    _blocks_returned_counter =
593
523k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
523k
    _output_block_bytes_counter =
595
523k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
523k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
523k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
523k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
523k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
523k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
523k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
523k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
523k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
523k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
523k
    _memory_used_counter =
606
523k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
523k
    _common_profile->add_info_string("IsColocate",
608
523k
                                     std::to_string(_parent->is_colocated_operator()));
609
523k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
523k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
523k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
523k
    return Status::OK();
613
523k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
164
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
164
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
164
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
164
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
164
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
164
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
164
    _operator_profile->add_child(_common_profile.get(), true);
557
164
    _operator_profile->add_child(_custom_profile.get(), true);
558
164
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
164
    if constexpr (!is_fake_shared) {
560
164
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
164
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
164
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
164
            _dependency = _shared_state->create_source_dependency(
576
164
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
164
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
164
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
164
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
164
    }
585
586
164
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
164
    _rows_returned_counter =
591
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
164
    _blocks_returned_counter =
593
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
164
    _output_block_bytes_counter =
595
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
164
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
164
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
164
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
164
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
164
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
164
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
164
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
164
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
164
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
164
    _memory_used_counter =
606
164
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
164
    _common_profile->add_info_string("IsColocate",
608
164
                                     std::to_string(_parent->is_colocated_operator()));
609
164
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
164
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
164
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
164
    return Status::OK();
613
164
}
614
615
template <typename SharedStateArg>
616
1.77M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.77M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.05M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
280k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
280k
    }
621
1.77M
    if (_parent->has_projection()) {
622
338k
        const auto& projection = *_parent->_projection;
623
338k
        _projections.resize(projection.projections.size());
624
2.09M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.75M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.75M
        }
627
338k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
345k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.48k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
40.3k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
33.8k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
33.8k
                        state, _intermediate_projections[i][j]));
633
33.8k
            }
634
6.48k
        }
635
338k
    }
636
1.77M
    return Status::OK();
637
1.77M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
63.1k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
63.1k
    _conjuncts.resize(_parent->_conjuncts.size());
618
63.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
737
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
737
    }
621
63.1k
    if (_parent->has_projection()) {
622
63.0k
        const auto& projection = *_parent->_projection;
623
63.0k
        _projections.resize(projection.projections.size());
624
313k
        for (size_t i = 0; i < _projections.size(); i++) {
625
250k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
250k
        }
627
63.0k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
64.0k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
967
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
7.57k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
6.60k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
6.60k
                        state, _intermediate_projections[i][j]));
633
6.60k
            }
634
967
        }
635
63.0k
    }
636
63.1k
    return Status::OK();
637
63.1k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
3
    _conjuncts.resize(_parent->_conjuncts.size());
618
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
3
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
3
    return Status::OK();
637
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
157k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
157k
    _conjuncts.resize(_parent->_conjuncts.size());
618
157k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
157k
    if (_parent->has_projection()) {
622
78
        const auto& projection = *_parent->_projection;
623
78
        _projections.resize(projection.projections.size());
624
398
        for (size_t i = 0; i < _projections.size(); i++) {
625
320
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
320
        }
627
78
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
78
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
78
    }
636
157k
    return Status::OK();
637
157k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
33
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
33
    _conjuncts.resize(_parent->_conjuncts.size());
618
33
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
33
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
33
    return Status::OK();
637
33
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.81k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.81k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.96k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
152
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
152
    }
621
5.81k
    if (_parent->has_projection()) {
622
5.81k
        const auto& projection = *_parent->_projection;
623
5.81k
        _projections.resize(projection.projections.size());
624
22.5k
        for (size_t i = 0; i < _projections.size(); i++) {
625
16.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
16.7k
        }
627
5.81k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.85k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
42
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
303
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
261
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
261
                        state, _intermediate_projections[i][j]));
633
261
            }
634
42
        }
635
5.81k
    }
636
5.81k
    return Status::OK();
637
5.81k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.30k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.30k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.14k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
841
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
841
    }
621
8.30k
    if (_parent->has_projection()) {
622
4.25k
        const auto& projection = *_parent->_projection;
623
4.25k
        _projections.resize(projection.projections.size());
624
17.4k
        for (size_t i = 0; i < _projections.size(); i++) {
625
13.1k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
13.1k
        }
627
4.25k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.34k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
87
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
656
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
569
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
569
                        state, _intermediate_projections[i][j]));
633
569
            }
634
87
        }
635
4.25k
    }
636
8.30k
    return Status::OK();
637
8.30k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
85.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
85.2k
    _conjuncts.resize(_parent->_conjuncts.size());
618
86.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.43k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.43k
    }
621
85.2k
    if (_parent->has_projection()) {
622
27.1k
        const auto& projection = *_parent->_projection;
623
27.1k
        _projections.resize(projection.projections.size());
624
236k
        for (size_t i = 0; i < _projections.size(); i++) {
625
209k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
209k
        }
627
27.1k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
27.3k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
169
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.07k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
902
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
902
                        state, _intermediate_projections[i][j]));
633
902
            }
634
169
        }
635
27.1k
    }
636
85.2k
    return Status::OK();
637
85.2k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
80.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
80.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
80.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
8
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
8
    }
621
80.6k
    if (_parent->has_projection()) {
622
104
        const auto& projection = *_parent->_projection;
623
104
        _projections.resize(projection.projections.size());
624
382
        for (size_t i = 0; i < _projections.size(); i++) {
625
278
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
278
        }
627
104
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
104
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
104
    }
636
80.6k
    return Status::OK();
637
80.6k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
46
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
46
    _conjuncts.resize(_parent->_conjuncts.size());
618
46
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
46
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
46
    return Status::OK();
637
46
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
790k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
790k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.06M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
276k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
276k
    }
621
790k
    if (_parent->has_projection()) {
622
228k
        const auto& projection = *_parent->_projection;
623
228k
        _projections.resize(projection.projections.size());
624
1.40M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.18M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.18M
        }
627
228k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
233k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
5.21k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
30.6k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
25.4k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
25.4k
                        state, _intermediate_projections[i][j]));
633
25.4k
            }
634
5.21k
        }
635
228k
    }
636
790k
    return Status::OK();
637
790k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
50.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
50.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
50.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
50.6k
    if (_parent->has_projection()) {
622
9.69k
        const auto& projection = *_parent->_projection;
623
9.69k
        _projections.resize(projection.projections.size());
624
94.5k
        for (size_t i = 0; i < _projections.size(); i++) {
625
84.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
84.8k
        }
627
9.69k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
9.70k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
39
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
32
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
32
                        state, _intermediate_projections[i][j]));
633
32
            }
634
7
        }
635
9.69k
    }
636
50.6k
    return Status::OK();
637
50.6k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
4.30k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
4.30k
    _conjuncts.resize(_parent->_conjuncts.size());
618
4.71k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
412
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
412
    }
621
4.30k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
4.30k
    return Status::OK();
637
4.30k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
462
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
462
    _conjuncts.resize(_parent->_conjuncts.size());
618
462
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
462
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
462
    return Status::OK();
637
462
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.17k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.17k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.17k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
5.17k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
228
        for (size_t i = 0; i < _projections.size(); i++) {
625
168
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
168
        }
627
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
60
    }
636
5.17k
    return Status::OK();
637
5.17k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
526k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
526k
    _conjuncts.resize(_parent->_conjuncts.size());
618
526k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
526k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
526k
    return Status::OK();
637
526k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
164
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
164
    _conjuncts.resize(_parent->_conjuncts.size());
618
171
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
164
    if (_parent->has_projection()) {
622
161
        const auto& projection = *_parent->_projection;
623
161
        _projections.resize(projection.projections.size());
624
480
        for (size_t i = 0; i < _projections.size(); i++) {
625
319
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
319
        }
627
161
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
164
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
161
    }
636
164
    return Status::OK();
637
164
}
638
639
template <typename SharedStateArg>
640
7.99k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.99k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
7.99k
    _terminated = true;
645
7.99k
    return Status::OK();
646
7.99k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
411
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
411
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
411
    _terminated = true;
645
411
    return Status::OK();
646
411
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
15
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
15
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
14
    _terminated = true;
645
14
    return Status::OK();
646
15
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
41
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
41
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
41
    _terminated = true;
645
41
    return Status::OK();
646
41
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
23
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
23
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
23
    _terminated = true;
645
23
    return Status::OK();
646
23
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
6.30k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.30k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.30k
    _terminated = true;
645
6.30k
    return Status::OK();
646
6.30k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
7
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7
    _terminated = true;
645
7
    return Status::OK();
646
7
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
5
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
5
    _terminated = true;
645
5
    return Status::OK();
646
5
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
2
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
2
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
2
    _terminated = true;
645
2
    return Status::OK();
646
2
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.14k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.14k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1.14k
    _terminated = true;
645
1.14k
    return Status::OK();
646
1.14k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
35
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
35
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
35
    _terminated = true;
645
35
    return Status::OK();
646
35
}
647
648
template <typename SharedStateArg>
649
1.96M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
1.96M
    if (_closed) {
651
186k
        return Status::OK();
652
186k
    }
653
1.77M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
986k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
986k
    }
656
1.77M
    _closed = true;
657
1.77M
    return Status::OK();
658
1.96M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
63.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
63.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
63.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
63.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
63.0k
    }
656
63.0k
    _closed = true;
657
63.0k
    return Status::OK();
658
63.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4
    }
656
4
    _closed = true;
657
4
    return Status::OK();
658
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
313k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
313k
    if (_closed) {
651
156k
        return Status::OK();
652
156k
    }
653
156k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
156k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
156k
    }
656
156k
    _closed = true;
657
156k
    return Status::OK();
658
313k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
33
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
33
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
33
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
33
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
33
    }
656
33
    _closed = true;
657
33
    return Status::OK();
658
33
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.80k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.80k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.80k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.80k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.80k
    }
656
5.80k
    _closed = true;
657
5.80k
    return Status::OK();
658
5.80k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
16.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
16.7k
    if (_closed) {
651
8.47k
        return Status::OK();
652
8.47k
    }
653
8.27k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.27k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.27k
    }
656
8.27k
    _closed = true;
657
8.27k
    return Status::OK();
658
16.7k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
85.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
85.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
85.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
85.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
85.0k
    }
656
85.0k
    _closed = true;
657
85.0k
    return Status::OK();
658
85.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
80.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
80.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
80.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
80.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
80.2k
    }
656
80.2k
    _closed = true;
657
80.2k
    return Status::OK();
658
80.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
41
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
41
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
41
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
41
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
41
    }
656
41
    _closed = true;
657
41
    return Status::OK();
658
41
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
806k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
806k
    if (_closed) {
651
15.0k
        return Status::OK();
652
15.0k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
791k
    _closed = true;
657
791k
    return Status::OK();
658
806k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
50.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
50.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
50.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
50.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
50.6k
    }
656
50.6k
    _closed = true;
657
50.6k
    return Status::OK();
658
50.6k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4.29k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4.29k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4.29k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4.29k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4.29k
    }
656
4.29k
    _closed = true;
657
4.29k
    return Status::OK();
658
4.29k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
724
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
724
    if (_closed) {
651
362
        return Status::OK();
652
362
    }
653
362
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
362
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
362
    }
656
362
    _closed = true;
657
362
    return Status::OK();
658
724
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.4k
    if (_closed) {
651
5.25k
        return Status::OK();
652
5.25k
    }
653
5.16k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.16k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.16k
    }
656
5.16k
    _closed = true;
657
5.16k
    return Status::OK();
658
10.4k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
527k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
527k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
527k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
527k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
527k
    }
656
527k
    _closed = true;
657
527k
    return Status::OK();
658
527k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
323
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
323
    if (_closed) {
651
168
        return Status::OK();
652
168
    }
653
155
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
155
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
155
    }
656
155
    _closed = true;
657
155
    return Status::OK();
658
323
}
659
660
template <typename SharedState>
661
1.47M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.47M
    _operator_profile =
664
1.47M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.47M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.47M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
1.47M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.47M
    _operator_profile->add_child(_common_profile, true);
673
1.47M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.47M
    _operator_profile->set_metadata(_parent->node_id());
676
1.47M
    _wait_for_finish_dependency_timer =
677
1.47M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.47M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.47M
    if constexpr (!is_fake_shared) {
680
1.06M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.06M
            info.shared_state_map.end()) {
682
285k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
191k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
191k
            }
685
285k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
285k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
285k
                                                  ? 0
688
285k
                                                  : info.task_idx]
689
285k
                                  .get();
690
285k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
775k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
775k
            _shared_state = info.shared_state->template cast<SharedState>();
696
775k
            _dependency = _shared_state->create_sink_dependency(
697
775k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
775k
        }
699
1.06M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.06M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.06M
    }
702
703
1.47M
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
1.47M
    _rows_input_counter =
708
1.47M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.47M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.47M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.47M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.47M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.47M
    _memory_used_counter =
714
1.47M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.47M
    _common_profile->add_info_string("IsColocate",
716
1.47M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.47M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.47M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.47M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.47M
    return Status::OK();
721
1.47M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
110k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
110k
    _operator_profile =
664
110k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
110k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
110k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
110k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
110k
    _operator_profile->add_child(_common_profile, true);
673
110k
    _operator_profile->add_child(_custom_profile, true);
674
675
110k
    _operator_profile->set_metadata(_parent->node_id());
676
110k
    _wait_for_finish_dependency_timer =
677
110k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
110k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
110k
    if constexpr (!is_fake_shared) {
680
110k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
110k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
12.6k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
12.6k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
12.6k
                                                  ? 0
688
12.6k
                                                  : info.task_idx]
689
12.6k
                                  .get();
690
12.6k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
98.3k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
98.3k
            _shared_state = info.shared_state->template cast<SharedState>();
696
98.3k
            _dependency = _shared_state->create_sink_dependency(
697
98.3k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
98.3k
        }
699
110k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
110k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
110k
    }
702
703
110k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
110k
    _rows_input_counter =
708
110k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
110k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
110k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
110k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
110k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
110k
    _memory_used_counter =
714
110k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
110k
    _common_profile->add_info_string("IsColocate",
716
110k
                                     std::to_string(_parent->is_colocated_operator()));
717
110k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
110k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
110k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
110k
    return Status::OK();
721
110k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2
    _operator_profile =
664
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2
    _operator_profile->add_child(_common_profile, true);
673
2
    _operator_profile->add_child(_custom_profile, true);
674
675
2
    _operator_profile->set_metadata(_parent->node_id());
676
2
    _wait_for_finish_dependency_timer =
677
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2
    if constexpr (!is_fake_shared) {
680
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2
            _shared_state = info.shared_state->template cast<SharedState>();
696
2
            _dependency = _shared_state->create_sink_dependency(
697
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2
        }
699
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2
    }
702
703
2
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2
    _rows_input_counter =
708
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2
    _memory_used_counter =
714
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2
    _common_profile->add_info_string("IsColocate",
716
2
                                     std::to_string(_parent->is_colocated_operator()));
717
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2
    return Status::OK();
721
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
157k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
157k
    _operator_profile =
664
157k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
157k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
157k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
157k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
157k
    _operator_profile->add_child(_common_profile, true);
673
157k
    _operator_profile->add_child(_custom_profile, true);
674
675
157k
    _operator_profile->set_metadata(_parent->node_id());
676
157k
    _wait_for_finish_dependency_timer =
677
157k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
157k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
157k
    if constexpr (!is_fake_shared) {
680
157k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
157k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
157k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
157k
            _shared_state = info.shared_state->template cast<SharedState>();
696
157k
            _dependency = _shared_state->create_sink_dependency(
697
157k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
157k
        }
699
157k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
157k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
157k
    }
702
703
157k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
157k
    _rows_input_counter =
708
157k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
157k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
157k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
157k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
157k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
157k
    _memory_used_counter =
714
157k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
157k
    _common_profile->add_info_string("IsColocate",
716
157k
                                     std::to_string(_parent->is_colocated_operator()));
717
157k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
157k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
157k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
157k
    return Status::OK();
721
157k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
40
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
40
    _operator_profile =
664
40
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
40
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
40
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
40
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
40
    _operator_profile->add_child(_common_profile, true);
673
40
    _operator_profile->add_child(_custom_profile, true);
674
675
40
    _operator_profile->set_metadata(_parent->node_id());
676
40
    _wait_for_finish_dependency_timer =
677
40
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
40
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
40
    if constexpr (!is_fake_shared) {
680
40
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
40
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
40
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
40
            _shared_state = info.shared_state->template cast<SharedState>();
696
40
            _dependency = _shared_state->create_sink_dependency(
697
40
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
40
        }
699
40
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
40
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
40
    }
702
703
40
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
40
    _rows_input_counter =
708
40
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
40
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
40
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
40
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
40
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
40
    _memory_used_counter =
714
40
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
40
    _common_profile->add_info_string("IsColocate",
716
40
                                     std::to_string(_parent->is_colocated_operator()));
717
40
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
40
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
40
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
40
    return Status::OK();
721
40
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.80k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.80k
    _operator_profile =
664
5.80k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.80k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.80k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
5.80k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.80k
    _operator_profile->add_child(_common_profile, true);
673
5.80k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.80k
    _operator_profile->set_metadata(_parent->node_id());
676
5.80k
    _wait_for_finish_dependency_timer =
677
5.80k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.80k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.80k
    if constexpr (!is_fake_shared) {
680
5.80k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.80k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
5.80k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.80k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.80k
            _dependency = _shared_state->create_sink_dependency(
697
5.80k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.80k
        }
699
5.80k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.80k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.80k
    }
702
703
5.80k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
5.80k
    _rows_input_counter =
708
5.80k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.80k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.80k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.80k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.80k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.80k
    _memory_used_counter =
714
5.80k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.80k
    _common_profile->add_info_string("IsColocate",
716
5.80k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.80k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.80k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.80k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.80k
    return Status::OK();
721
5.80k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.29k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.29k
    _operator_profile =
664
8.29k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.29k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.29k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.29k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.29k
    _operator_profile->add_child(_common_profile, true);
673
8.29k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.29k
    _operator_profile->set_metadata(_parent->node_id());
676
8.29k
    _wait_for_finish_dependency_timer =
677
8.29k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.29k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.29k
    if constexpr (!is_fake_shared) {
680
8.29k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.29k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.29k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.29k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.29k
            _dependency = _shared_state->create_sink_dependency(
697
8.29k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.29k
        }
699
8.29k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.29k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.29k
    }
702
703
8.29k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.29k
    _rows_input_counter =
708
8.29k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.29k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.29k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.29k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.29k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.29k
    _memory_used_counter =
714
8.29k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.29k
    _common_profile->add_info_string("IsColocate",
716
8.29k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.29k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.29k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.29k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.29k
    return Status::OK();
721
8.29k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
84.9k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
84.9k
    _operator_profile =
664
84.9k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
84.9k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
84.9k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
84.9k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
84.9k
    _operator_profile->add_child(_common_profile, true);
673
84.9k
    _operator_profile->add_child(_custom_profile, true);
674
675
84.9k
    _operator_profile->set_metadata(_parent->node_id());
676
84.9k
    _wait_for_finish_dependency_timer =
677
84.9k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
84.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
84.9k
    if constexpr (!is_fake_shared) {
680
84.9k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
84.9k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
84.9k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
84.9k
            _shared_state = info.shared_state->template cast<SharedState>();
696
84.9k
            _dependency = _shared_state->create_sink_dependency(
697
84.9k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
84.9k
        }
699
84.9k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
84.9k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
84.9k
    }
702
703
84.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
84.9k
    _rows_input_counter =
708
84.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
84.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
84.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
84.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
84.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
84.9k
    _memory_used_counter =
714
84.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
84.9k
    _common_profile->add_info_string("IsColocate",
716
84.9k
                                     std::to_string(_parent->is_colocated_operator()));
717
84.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
84.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
84.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
84.9k
    return Status::OK();
721
84.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
80.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
80.4k
    _operator_profile =
664
80.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
80.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
80.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
80.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
80.4k
    _operator_profile->add_child(_common_profile, true);
673
80.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
80.4k
    _operator_profile->set_metadata(_parent->node_id());
676
80.4k
    _wait_for_finish_dependency_timer =
677
80.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
80.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
80.4k
    if constexpr (!is_fake_shared) {
680
80.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
80.5k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
80.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
80.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
80.5k
                                                  ? 0
688
80.5k
                                                  : info.task_idx]
689
80.5k
                                  .get();
690
80.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
80.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
80.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
80.4k
    }
702
703
80.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
80.4k
    _rows_input_counter =
708
80.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
80.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
80.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
80.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
80.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
80.4k
    _memory_used_counter =
714
80.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
80.4k
    _common_profile->add_info_string("IsColocate",
716
80.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
80.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
80.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
80.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
80.4k
    return Status::OK();
721
80.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
52
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
52
    _operator_profile =
664
52
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
52
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
52
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
52
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
52
    _operator_profile->add_child(_common_profile, true);
673
52
    _operator_profile->add_child(_custom_profile, true);
674
675
52
    _operator_profile->set_metadata(_parent->node_id());
676
52
    _wait_for_finish_dependency_timer =
677
52
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
52
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
52
    if constexpr (!is_fake_shared) {
680
52
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
52
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
52
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
52
            _shared_state = info.shared_state->template cast<SharedState>();
696
52
            _dependency = _shared_state->create_sink_dependency(
697
52
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
52
        }
699
52
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
52
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
52
    }
702
703
52
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
52
    _rows_input_counter =
708
52
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
52
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
52
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
52
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
52
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
52
    _memory_used_counter =
714
52
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
52
    _common_profile->add_info_string("IsColocate",
716
52
                                     std::to_string(_parent->is_colocated_operator()));
717
52
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
52
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
52
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
52
    return Status::OK();
721
52
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
417k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
417k
    _operator_profile =
664
417k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
417k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
417k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
417k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
417k
    _operator_profile->add_child(_common_profile, true);
673
417k
    _operator_profile->add_child(_custom_profile, true);
674
675
417k
    _operator_profile->set_metadata(_parent->node_id());
676
417k
    _wait_for_finish_dependency_timer =
677
417k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
417k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
    if constexpr (!is_fake_shared) {
680
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
                                                  ? 0
688
                                                  : info.task_idx]
689
                                  .get();
690
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
            _shared_state = info.shared_state->template cast<SharedState>();
696
            _dependency = _shared_state->create_sink_dependency(
697
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
        }
699
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
    }
702
703
417k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
417k
    _rows_input_counter =
708
417k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
417k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
417k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
417k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
417k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
417k
    _memory_used_counter =
714
417k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
417k
    _common_profile->add_info_string("IsColocate",
716
417k
                                     std::to_string(_parent->is_colocated_operator()));
717
417k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
417k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
417k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
417k
    return Status::OK();
721
417k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
3.91k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
3.91k
    _operator_profile =
664
3.91k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
3.91k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
3.91k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
3.91k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
3.91k
    _operator_profile->add_child(_common_profile, true);
673
3.91k
    _operator_profile->add_child(_custom_profile, true);
674
675
3.91k
    _operator_profile->set_metadata(_parent->node_id());
676
3.91k
    _wait_for_finish_dependency_timer =
677
3.91k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
3.91k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
3.91k
    if constexpr (!is_fake_shared) {
680
3.91k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
3.91k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
3.91k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
3.91k
            _shared_state = info.shared_state->template cast<SharedState>();
696
3.91k
            _dependency = _shared_state->create_sink_dependency(
697
3.91k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
3.91k
        }
699
3.91k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
3.91k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
3.91k
    }
702
703
3.91k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
3.91k
    _rows_input_counter =
708
3.91k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
3.91k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
3.91k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
3.91k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
3.91k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
3.91k
    _memory_used_counter =
714
3.91k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
3.91k
    _common_profile->add_info_string("IsColocate",
716
3.91k
                                     std::to_string(_parent->is_colocated_operator()));
717
3.91k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
3.91k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
3.91k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
3.91k
    return Status::OK();
721
3.91k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
464
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
464
    _operator_profile =
664
464
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
464
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
464
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
464
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
464
    _operator_profile->add_child(_common_profile, true);
673
464
    _operator_profile->add_child(_custom_profile, true);
674
675
464
    _operator_profile->set_metadata(_parent->node_id());
676
464
    _wait_for_finish_dependency_timer =
677
464
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
464
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
464
    if constexpr (!is_fake_shared) {
680
464
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
464
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
464
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
464
            _shared_state = info.shared_state->template cast<SharedState>();
696
464
            _dependency = _shared_state->create_sink_dependency(
697
464
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
464
        }
699
464
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
464
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
464
    }
702
703
464
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
464
    _rows_input_counter =
708
464
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
464
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
464
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
464
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
464
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
464
    _memory_used_counter =
714
464
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
464
    _common_profile->add_info_string("IsColocate",
716
464
                                     std::to_string(_parent->is_colocated_operator()));
717
464
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
464
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
464
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
464
    return Status::OK();
721
464
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
1.69k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.69k
    _operator_profile =
664
1.69k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.69k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.69k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
1.69k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.69k
    _operator_profile->add_child(_common_profile, true);
673
1.69k
    _operator_profile->add_child(_custom_profile, true);
674
675
1.69k
    _operator_profile->set_metadata(_parent->node_id());
676
1.69k
    _wait_for_finish_dependency_timer =
677
1.69k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.69k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.69k
    if constexpr (!is_fake_shared) {
680
1.69k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.69k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
1.69k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
1.69k
            _shared_state = info.shared_state->template cast<SharedState>();
696
1.69k
            _dependency = _shared_state->create_sink_dependency(
697
1.69k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
1.69k
        }
699
1.69k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.69k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.69k
    }
702
703
1.69k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
1.69k
    _rows_input_counter =
708
1.69k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.69k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.69k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.69k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.69k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.69k
    _memory_used_counter =
714
1.69k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.69k
    _common_profile->add_info_string("IsColocate",
716
1.69k
                                     std::to_string(_parent->is_colocated_operator()));
717
1.69k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.69k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.69k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.69k
    return Status::OK();
721
1.69k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.5k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.5k
    _operator_profile =
664
12.5k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.5k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.5k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.5k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.5k
    _operator_profile->add_child(_common_profile, true);
673
12.5k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.5k
    _operator_profile->set_metadata(_parent->node_id());
676
12.5k
    _wait_for_finish_dependency_timer =
677
12.5k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.5k
    if constexpr (!is_fake_shared) {
680
12.5k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.5k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.5k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.5k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.5k
            _dependency = _shared_state->create_sink_dependency(
697
12.5k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.5k
        }
699
12.5k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.5k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.5k
    }
702
703
12.5k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.5k
    _rows_input_counter =
708
12.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.5k
    _memory_used_counter =
714
12.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.5k
    _common_profile->add_info_string("IsColocate",
716
12.5k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.5k
    return Status::OK();
721
12.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
191k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
191k
    _operator_profile =
664
191k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
191k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
191k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
191k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
191k
    _operator_profile->add_child(_common_profile, true);
673
191k
    _operator_profile->add_child(_custom_profile, true);
674
675
191k
    _operator_profile->set_metadata(_parent->node_id());
676
191k
    _wait_for_finish_dependency_timer =
677
191k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
191k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
191k
    if constexpr (!is_fake_shared) {
680
191k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
191k
            info.shared_state_map.end()) {
682
191k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
191k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
191k
            }
685
191k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
191k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
191k
                                                  ? 0
688
191k
                                                  : info.task_idx]
689
191k
                                  .get();
690
191k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
191k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
191k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
191k
    }
702
703
191k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
191k
    _rows_input_counter =
708
191k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
191k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
191k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
191k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
191k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
191k
    _memory_used_counter =
714
191k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
191k
    _common_profile->add_info_string("IsColocate",
716
191k
                                     std::to_string(_parent->is_colocated_operator()));
717
191k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
191k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
191k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
191k
    return Status::OK();
721
191k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
401k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
401k
    _operator_profile =
664
401k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
401k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
401k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
401k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
401k
    _operator_profile->add_child(_common_profile, true);
673
401k
    _operator_profile->add_child(_custom_profile, true);
674
675
401k
    _operator_profile->set_metadata(_parent->node_id());
676
401k
    _wait_for_finish_dependency_timer =
677
401k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
401k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
401k
    if constexpr (!is_fake_shared) {
680
401k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
401k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
401k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
401k
            _shared_state = info.shared_state->template cast<SharedState>();
696
401k
            _dependency = _shared_state->create_sink_dependency(
697
401k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
401k
        }
699
401k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
401k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
401k
    }
702
703
401k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
401k
    _rows_input_counter =
708
401k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
401k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
401k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
401k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
401k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
401k
    _memory_used_counter =
714
401k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
401k
    _common_profile->add_info_string("IsColocate",
716
401k
                                     std::to_string(_parent->is_colocated_operator()));
717
401k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
401k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
401k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
401k
    return Status::OK();
721
401k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
25
    _operator_profile =
664
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
25
    _operator_profile->add_child(_common_profile, true);
673
25
    _operator_profile->add_child(_custom_profile, true);
674
675
25
    _operator_profile->set_metadata(_parent->node_id());
676
25
    _wait_for_finish_dependency_timer =
677
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
25
    if constexpr (!is_fake_shared) {
680
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
25
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
25
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
25
            _shared_state = info.shared_state->template cast<SharedState>();
696
25
            _dependency = _shared_state->create_sink_dependency(
697
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
25
        }
699
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
25
    }
702
703
25
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
25
    _rows_input_counter =
708
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
25
    _memory_used_counter =
714
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
25
    _common_profile->add_info_string("IsColocate",
716
25
                                     std::to_string(_parent->is_colocated_operator()));
717
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
25
    return Status::OK();
721
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
328
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
328
    _operator_profile =
664
328
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
328
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
328
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
328
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
328
    _operator_profile->add_child(_common_profile, true);
673
328
    _operator_profile->add_child(_custom_profile, true);
674
675
328
    _operator_profile->set_metadata(_parent->node_id());
676
328
    _wait_for_finish_dependency_timer =
677
328
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
328
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
328
    if constexpr (!is_fake_shared) {
680
328
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
328
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
328
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
328
            _shared_state = info.shared_state->template cast<SharedState>();
696
328
            _dependency = _shared_state->create_sink_dependency(
697
328
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
328
        }
699
328
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
328
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
328
    }
702
703
328
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
328
    _rows_input_counter =
708
328
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
328
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
328
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
328
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
328
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
328
    _memory_used_counter =
714
328
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
328
    _common_profile->add_info_string("IsColocate",
716
328
                                     std::to_string(_parent->is_colocated_operator()));
717
328
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
328
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
328
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
328
    return Status::OK();
721
328
}
722
723
template <typename SharedState>
724
1.48M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.48M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.48M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.06M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.06M
    }
731
1.48M
    _closed = true;
732
1.48M
    return Status::OK();
733
1.48M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
111k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
111k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
111k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
111k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
111k
    }
731
111k
    _closed = true;
732
111k
    return Status::OK();
733
111k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1
    }
731
1
    _closed = true;
732
1
    return Status::OK();
733
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
157k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
157k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
157k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
157k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
157k
    }
731
157k
    _closed = true;
732
157k
    return Status::OK();
733
157k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
31
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
31
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
29
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
29
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
29
    }
731
29
    _closed = true;
732
29
    return Status::OK();
733
31
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.79k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.79k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.79k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.79k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.79k
    }
731
5.79k
    _closed = true;
732
5.79k
    return Status::OK();
733
5.79k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.26k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.26k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.26k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.26k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.26k
    }
731
8.26k
    _closed = true;
732
8.26k
    return Status::OK();
733
8.26k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
84.9k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
84.9k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
84.9k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
84.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
84.9k
    }
731
84.9k
    _closed = true;
732
84.9k
    return Status::OK();
733
84.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
80.2k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
80.2k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
80.2k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
80.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
80.2k
    }
731
80.2k
    _closed = true;
732
80.2k
    return Status::OK();
733
80.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
41
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
41
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
41
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
41
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
41
    }
731
41
    _closed = true;
732
41
    return Status::OK();
733
41
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
420k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
420k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
    }
731
420k
    _closed = true;
732
420k
    return Status::OK();
733
420k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
3.91k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
3.91k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
3.91k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
3.91k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
3.91k
    }
731
3.91k
    _closed = true;
732
3.91k
    return Status::OK();
733
3.91k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
360
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
360
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
360
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
360
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
360
    }
731
360
    _closed = true;
732
360
    return Status::OK();
733
360
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1.70k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.70k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1.70k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.70k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.70k
    }
731
1.70k
    _closed = true;
732
1.70k
    return Status::OK();
733
1.70k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.6k
    }
731
12.6k
    _closed = true;
732
12.6k
    return Status::OK();
733
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
192k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
192k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
192k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
192k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
192k
    }
731
192k
    _closed = true;
732
192k
    return Status::OK();
733
192k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
405k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
405k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
405k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
405k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
405k
    }
731
405k
    _closed = true;
732
405k
    return Status::OK();
733
405k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
14
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
14
    }
731
14
    _closed = true;
732
14
    return Status::OK();
733
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
328
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
328
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
328
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
328
    }
731
328
    _closed = true;
732
328
    return Status::OK();
733
328
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
4.24k
                                                          bool* eos) {
738
4.24k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.23k
    return pull(state, block, eos);
740
4.24k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
38
                                                          bool* eos) {
738
38
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
38
    return pull(state, block, eos);
740
38
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.20k
                                                          bool* eos) {
738
4.20k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.19k
    return pull(state, block, eos);
740
4.20k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
498k
                                                         bool* eos) {
745
498k
    auto& local_state = get_local_state(state);
746
498k
    if (need_more_input_data(state)) {
747
470k
        local_state._child_block->clear_column_data(
748
470k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
470k
                        .num_materialized_slots());
750
470k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
470k
                state, local_state._child_block.get(), &local_state._child_eos));
752
470k
        *eos = local_state._child_eos;
753
470k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
61.2k
            return Status::OK();
755
61.2k
        }
756
408k
        {
757
408k
            SCOPED_TIMER(local_state.exec_time_counter());
758
408k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
408k
        }
760
408k
    }
761
762
436k
    if (!need_more_input_data(state)) {
763
412k
        SCOPED_TIMER(local_state.exec_time_counter());
764
412k
        bool new_eos = false;
765
412k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
412k
        if (new_eos) {
767
336k
            *eos = true;
768
336k
        } else if (!need_more_input_data(state)) {
769
23.0k
            *eos = false;
770
23.0k
        }
771
412k
    }
772
436k
    return Status::OK();
773
436k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
138k
                                                         bool* eos) {
745
138k
    auto& local_state = get_local_state(state);
746
138k
    if (need_more_input_data(state)) {
747
123k
        local_state._child_block->clear_column_data(
748
123k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
123k
                        .num_materialized_slots());
750
123k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
123k
                state, local_state._child_block.get(), &local_state._child_eos));
752
123k
        *eos = local_state._child_eos;
753
123k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
44.2k
            return Status::OK();
755
44.2k
        }
756
79.1k
        {
757
79.1k
            SCOPED_TIMER(local_state.exec_time_counter());
758
79.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
79.1k
        }
760
79.1k
    }
761
762
94.1k
    if (!need_more_input_data(state)) {
763
94.1k
        SCOPED_TIMER(local_state.exec_time_counter());
764
94.1k
        bool new_eos = false;
765
94.1k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
94.1k
        if (new_eos) {
767
38.7k
            *eos = true;
768
55.3k
        } else if (!need_more_input_data(state)) {
769
9.09k
            *eos = false;
770
9.09k
        }
771
94.1k
    }
772
94.0k
    return Status::OK();
773
94.0k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.21k
                                                         bool* eos) {
745
4.21k
    auto& local_state = get_local_state(state);
746
4.21k
    if (need_more_input_data(state)) {
747
2.34k
        local_state._child_block->clear_column_data(
748
2.34k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.34k
                        .num_materialized_slots());
750
2.34k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.34k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.34k
        *eos = local_state._child_eos;
753
2.34k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
287
            return Status::OK();
755
287
        }
756
2.06k
        {
757
2.06k
            SCOPED_TIMER(local_state.exec_time_counter());
758
2.06k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
2.06k
        }
760
2.06k
    }
761
762
3.95k
    if (!need_more_input_data(state)) {
763
3.95k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.95k
        bool new_eos = false;
765
3.95k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.95k
        if (new_eos) {
767
1.44k
            *eos = true;
768
2.50k
        } else if (!need_more_input_data(state)) {
769
1.88k
            *eos = false;
770
1.88k
        }
771
3.95k
    }
772
3.92k
    return Status::OK();
773
3.92k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.89k
                                                         bool* eos) {
745
1.89k
    auto& local_state = get_local_state(state);
746
1.89k
    if (need_more_input_data(state)) {
747
1.89k
        local_state._child_block->clear_column_data(
748
1.89k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.89k
                        .num_materialized_slots());
750
1.89k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.89k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.89k
        *eos = local_state._child_eos;
753
1.89k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
770
            return Status::OK();
755
770
        }
756
1.12k
        {
757
1.12k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.12k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.12k
        }
760
1.12k
    }
761
762
1.12k
    if (!need_more_input_data(state)) {
763
1.12k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.12k
        bool new_eos = false;
765
1.12k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.12k
        if (new_eos) {
767
779
            *eos = true;
768
779
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.12k
    }
772
1.12k
    return Status::OK();
773
1.12k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
16.3k
                                                         bool* eos) {
745
16.3k
    auto& local_state = get_local_state(state);
746
16.4k
    if (need_more_input_data(state)) {
747
16.4k
        local_state._child_block->clear_column_data(
748
16.4k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
16.4k
                        .num_materialized_slots());
750
16.4k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
16.4k
                state, local_state._child_block.get(), &local_state._child_eos));
752
16.4k
        *eos = local_state._child_eos;
753
16.4k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
4.61k
            return Status::OK();
755
4.61k
        }
756
11.7k
        {
757
11.7k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.7k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.7k
        }
760
11.7k
    }
761
762
11.7k
    if (!need_more_input_data(state)) {
763
6.00k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.00k
        bool new_eos = false;
765
6.00k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.00k
        if (new_eos) {
767
5.94k
            *eos = true;
768
5.94k
        } else if (!need_more_input_data(state)) {
769
15
            *eos = false;
770
15
        }
771
6.00k
    }
772
11.7k
    return Status::OK();
773
11.7k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
308k
                                                         bool* eos) {
745
308k
    auto& local_state = get_local_state(state);
746
309k
    if (need_more_input_data(state)) {
747
309k
        local_state._child_block->clear_column_data(
748
309k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
309k
                        .num_materialized_slots());
750
309k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
309k
                state, local_state._child_block.get(), &local_state._child_eos));
752
309k
        *eos = local_state._child_eos;
753
309k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
9.60k
            return Status::OK();
755
9.60k
        }
756
299k
        {
757
299k
            SCOPED_TIMER(local_state.exec_time_counter());
758
299k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
299k
        }
760
299k
    }
761
762
299k
    if (!need_more_input_data(state)) {
763
281k
        SCOPED_TIMER(local_state.exec_time_counter());
764
281k
        bool new_eos = false;
765
281k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
281k
        if (new_eos) {
767
280k
            *eos = true;
768
280k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
281k
    }
772
299k
    return Status::OK();
773
299k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
21.8k
                                                         bool* eos) {
745
21.8k
    auto& local_state = get_local_state(state);
746
21.8k
    if (need_more_input_data(state)) {
747
10.1k
        local_state._child_block->clear_column_data(
748
10.1k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.1k
                        .num_materialized_slots());
750
10.1k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.1k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.1k
        *eos = local_state._child_eos;
753
10.1k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
886
            return Status::OK();
755
886
        }
756
9.28k
        {
757
9.28k
            SCOPED_TIMER(local_state.exec_time_counter());
758
9.28k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
9.28k
        }
760
9.28k
    }
761
762
21.0k
    if (!need_more_input_data(state)) {
763
20.4k
        SCOPED_TIMER(local_state.exec_time_counter());
764
20.4k
        bool new_eos = false;
765
20.4k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
20.4k
        if (new_eos) {
767
5.74k
            *eos = true;
768
14.6k
        } else if (!need_more_input_data(state)) {
769
11.7k
            *eos = false;
770
11.7k
        }
771
20.4k
    }
772
21.0k
    return Status::OK();
773
21.0k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
6.56k
                                                         bool* eos) {
745
6.56k
    auto& local_state = get_local_state(state);
746
6.56k
    if (need_more_input_data(state)) {
747
6.20k
        local_state._child_block->clear_column_data(
748
6.20k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.20k
                        .num_materialized_slots());
750
6.20k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.20k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.20k
        *eos = local_state._child_eos;
753
6.20k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
804
            return Status::OK();
755
804
        }
756
5.40k
        {
757
5.40k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.40k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.40k
        }
760
5.40k
    }
761
762
5.75k
    if (!need_more_input_data(state)) {
763
5.75k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.75k
        bool new_eos = false;
765
5.75k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.75k
        if (new_eos) {
767
3.71k
            *eos = true;
768
3.71k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
5.75k
    }
772
5.75k
    return Status::OK();
773
5.75k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
42.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
42.7k
    RETURN_IF_ERROR(Base::init(state, info));
779
42.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
42.7k
                                                         "AsyncWriterDependency", true);
781
42.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
42.7k
                             _finish_dependency));
783
784
42.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
42.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
42.7k
    return Status::OK();
787
42.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
355
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
355
    RETURN_IF_ERROR(Base::init(state, info));
779
355
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
355
                                                         "AsyncWriterDependency", true);
781
355
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
355
                             _finish_dependency));
783
784
355
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
355
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
355
    return Status::OK();
787
355
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
42.4k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
42.4k
    RETURN_IF_ERROR(Base::init(state, info));
779
42.4k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
42.4k
                                                         "AsyncWriterDependency", true);
781
42.4k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
42.4k
                             _finish_dependency));
783
784
42.4k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
42.4k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
42.4k
    return Status::OK();
787
42.4k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
43.3k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
43.3k
    RETURN_IF_ERROR(Base::open(state));
793
43.3k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
332k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
289k
        RETURN_IF_ERROR(
796
289k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
289k
    }
798
43.3k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
43.3k
    return Status::OK();
800
43.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
355
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
355
    RETURN_IF_ERROR(Base::open(state));
793
355
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.84k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.49k
        RETURN_IF_ERROR(
796
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.49k
    }
798
355
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
355
    return Status::OK();
800
355
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
42.9k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
42.9k
    RETURN_IF_ERROR(Base::open(state));
793
42.9k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
330k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
288k
        RETURN_IF_ERROR(
796
288k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
288k
    }
798
42.9k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
42.9k
    return Status::OK();
800
42.9k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
57.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
57.4k
    return _writer->sink(block, eos);
806
57.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.05k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.05k
    return _writer->sink(block, eos);
806
1.05k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
56.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
56.4k
    return _writer->sink(block, eos);
806
56.4k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
43.4k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
43.4k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
43.4k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
43.4k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
43.4k
    if (_writer) {
818
43.4k
        Status st = _writer->get_writer_status();
819
43.4k
        if (exec_status.ok()) {
820
43.3k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
43.3k
                                                       : Status::Cancelled("force close"));
822
43.3k
        } else {
823
74
            _writer->force_close(exec_status);
824
74
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
43.4k
        RETURN_IF_ERROR(st);
829
43.4k
    }
830
43.3k
    return Base::close(state, exec_status);
831
43.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
343
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
343
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
343
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
343
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
343
    if (_writer) {
818
343
        Status st = _writer->get_writer_status();
819
343
        if (exec_status.ok()) {
820
343
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
343
                                                       : Status::Cancelled("force close"));
822
343
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
343
        RETURN_IF_ERROR(st);
829
343
    }
830
343
    return Base::close(state, exec_status);
831
343
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
43.0k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
43.0k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
43.0k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
43.0k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
43.0k
    if (_writer) {
818
43.0k
        Status st = _writer->get_writer_status();
819
43.0k
        if (exec_status.ok()) {
820
43.0k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
43.0k
                                                       : Status::Cancelled("force close"));
822
43.0k
        } else {
823
74
            _writer->force_close(exec_status);
824
74
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
43.0k
        RETURN_IF_ERROR(st);
829
43.0k
    }
830
43.0k
    return Base::close(state, exec_status);
831
43.0k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
832
833
// An instantiation added outside the macros below needs the matching
834
// 'extern template' declaration in the operator's header (enforced by
835
// build-support/check-extern-template-pairing.py). Instantiations expanded
836
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
837
// skipped -- so their extern pairing has to be kept in sync by hand.
838
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
839
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
840
DECLARE_OPERATOR(ResultSinkLocalState)
841
DECLARE_OPERATOR(JdbcTableSinkLocalState)
842
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
843
DECLARE_OPERATOR(ResultFileSinkLocalState)
844
DECLARE_OPERATOR(OlapTableSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
846
DECLARE_OPERATOR(HiveTableSinkLocalState)
847
DECLARE_OPERATOR(TVFTableSinkLocalState)
848
DECLARE_OPERATOR(IcebergTableSinkLocalState)
849
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
850
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
851
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
852
DECLARE_OPERATOR(MCTableSinkLocalState)
853
DECLARE_OPERATOR(AnalyticSinkLocalState)
854
DECLARE_OPERATOR(BlackholeSinkLocalState)
855
DECLARE_OPERATOR(SortSinkLocalState)
856
DECLARE_OPERATOR(SpillSortSinkLocalState)
857
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
858
DECLARE_OPERATOR(AggSinkLocalState)
859
DECLARE_OPERATOR(BucketedAggSinkLocalState)
860
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
861
DECLARE_OPERATOR(ExchangeSinkLocalState)
862
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
863
DECLARE_OPERATOR(UnionSinkLocalState)
864
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
865
DECLARE_OPERATOR(PartitionSortSinkLocalState)
866
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
867
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
868
DECLARE_OPERATOR(SetSinkLocalState<true>)
869
DECLARE_OPERATOR(SetSinkLocalState<false>)
870
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
871
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
872
DECLARE_OPERATOR(CacheSinkLocalState)
873
DECLARE_OPERATOR(DictSinkLocalState)
874
DECLARE_OPERATOR(RecCTESinkLocalState)
875
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
876
877
#undef DECLARE_OPERATOR
878
879
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
880
DECLARE_OPERATOR(HashJoinProbeLocalState)
881
DECLARE_OPERATOR(OlapScanLocalState)
882
DECLARE_OPERATOR(GroupCommitLocalState)
883
DECLARE_OPERATOR(JDBCScanLocalState)
884
DECLARE_OPERATOR(FileScanLocalState)
885
DECLARE_OPERATOR(AnalyticLocalState)
886
DECLARE_OPERATOR(SortLocalState)
887
DECLARE_OPERATOR(SpillSortLocalState)
888
DECLARE_OPERATOR(LocalMergeSortLocalState)
889
DECLARE_OPERATOR(AggLocalState)
890
DECLARE_OPERATOR(BucketedAggLocalState)
891
DECLARE_OPERATOR(PartitionedAggLocalState)
892
DECLARE_OPERATOR(TableFunctionLocalState)
893
DECLARE_OPERATOR(ExchangeLocalState)
894
DECLARE_OPERATOR(RepeatLocalState)
895
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
896
DECLARE_OPERATOR(AssertNumRowsLocalState)
897
DECLARE_OPERATOR(EmptySetLocalState)
898
DECLARE_OPERATOR(UnionSourceLocalState)
899
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
900
DECLARE_OPERATOR(PartitionSortSourceLocalState)
901
DECLARE_OPERATOR(SetSourceLocalState<true>)
902
DECLARE_OPERATOR(SetSourceLocalState<false>)
903
DECLARE_OPERATOR(DataGenLocalState)
904
DECLARE_OPERATOR(SchemaScanLocalState)
905
DECLARE_OPERATOR(MetaScanLocalState)
906
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
907
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
908
DECLARE_OPERATOR(CacheSourceLocalState)
909
DECLARE_OPERATOR(RecCTESourceLocalState)
910
DECLARE_OPERATOR(RecCTEScanLocalState)
911
912
#ifdef BE_TEST
913
DECLARE_OPERATOR(MockLocalState)
914
DECLARE_OPERATOR(MockScanLocalState)
915
#endif
916
#undef DECLARE_OPERATOR
917
918
template class StreamingOperatorX<AssertNumRowsLocalState>;
919
template class StreamingOperatorX<SelectLocalState>;
920
921
template class StatefulOperatorX<HashJoinProbeLocalState>;
922
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
923
template class StatefulOperatorX<RepeatLocalState>;
924
template class StatefulOperatorX<MaterializationLocalState>;
925
template class StatefulOperatorX<StreamingAggLocalState>;
926
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
927
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
928
template class StatefulOperatorX<TableFunctionLocalState>;
929
930
template class PipelineXSinkLocalState<HashJoinSharedState>;
931
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
932
template class PipelineXSinkLocalState<SortSharedState>;
933
template class PipelineXSinkLocalState<SpillSortSharedState>;
934
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
935
template class PipelineXSinkLocalState<AnalyticSharedState>;
936
template class PipelineXSinkLocalState<AggSharedState>;
937
template class PipelineXSinkLocalState<BucketedAggSharedState>;
938
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
939
template class PipelineXSinkLocalState<FakeSharedState>;
940
template class PipelineXSinkLocalState<UnionSharedState>;
941
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
942
template class PipelineXSinkLocalState<MultiCastSharedState>;
943
template class PipelineXSinkLocalState<SetSharedState>;
944
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
945
template class PipelineXSinkLocalState<BasicSharedState>;
946
template class PipelineXSinkLocalState<DataQueueSharedState>;
947
template class PipelineXSinkLocalState<RecCTESharedState>;
948
949
template class PipelineXLocalState<HashJoinSharedState>;
950
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
951
template class PipelineXLocalState<SortSharedState>;
952
template class PipelineXLocalState<SpillSortSharedState>;
953
template class PipelineXLocalState<NestedLoopJoinSharedState>;
954
template class PipelineXLocalState<AnalyticSharedState>;
955
template class PipelineXLocalState<AggSharedState>;
956
template class PipelineXLocalState<BucketedAggSharedState>;
957
template class PipelineXLocalState<PartitionedAggSharedState>;
958
template class PipelineXLocalState<FakeSharedState>;
959
template class PipelineXLocalState<UnionSharedState>;
960
template class PipelineXLocalState<DataQueueSharedState>;
961
template class PipelineXLocalState<MultiCastSharedState>;
962
template class PipelineXLocalState<PartitionSortNodeSharedState>;
963
template class PipelineXLocalState<SetSharedState>;
964
template class PipelineXLocalState<LocalExchangeSharedState>;
965
template class PipelineXLocalState<BasicSharedState>;
966
template class PipelineXLocalState<RecCTESharedState>;
967
968
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
969
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
970
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
971
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
972
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
973
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
974
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
977
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
978
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
979
980
#ifdef BE_TEST
981
template class OperatorX<DummyOperatorLocalState>;
982
template class DataSinkOperatorX<DummySinkLocalState>;
983
#endif
984
985
} // namespace doris