Coverage Report

Created: 2026-09-15 20:38

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.84M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.84M
    if (_parent->nereids_id() == -1) {
122
962k
        return fmt::format("(id={})", _parent->node_id());
123
962k
    } else {
124
887k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
887k
    }
126
1.84M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
69.5k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
69.5k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
69.5k
    } else {
124
69.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
69.5k
    }
126
69.5k
}
_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
198k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
198k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
198k
    } else {
124
198k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
198k
    }
126
198k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
25
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
25
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
25
    } else {
124
25
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
25
    }
126
25
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
7.19k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
7.19k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
7.19k
    } else {
124
7.19k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7.19k
    }
126
7.19k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.98k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.98k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
6.97k
    } else {
124
6.97k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.97k
    }
126
6.98k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
86.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
86.4k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
86.4k
    } else {
124
86.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
86.4k
    }
126
86.4k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
104k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
104k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
104k
    } else {
124
104k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
104k
    }
126
104k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
176
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
176
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
176
    } else {
124
176
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
176
    }
126
176
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
648k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
648k
    if (_parent->nereids_id() == -1) {
122
294k
        return fmt::format("(id={})", _parent->node_id());
123
354k
    } else {
124
354k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
354k
    }
126
648k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.0k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.0k
    } else {
124
54.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.0k
    }
126
54.0k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.10k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.10k
    if (_parent->nereids_id() == -1) {
122
5.10k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
5.10k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
537
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
537
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
435
    } else {
124
435
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
435
    }
126
537
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.26k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.26k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.25k
    } else {
124
5.25k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.25k
    }
126
5.26k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
662k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
662k
    if (_parent->nereids_id() == -1) {
122
662k
        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
662k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
168
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
168
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
168
    } else {
124
168
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
168
    }
126
168
}
127
128
template <typename SharedStateArg>
129
1.25M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.25M
    if (_parent->nereids_id() == -1) {
131
721k
        return fmt::format("(id={})", _parent->node_id());
132
721k
    } else {
133
534k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
534k
    }
135
1.25M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
117k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
117k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
117k
    } else {
133
117k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
117k
    }
135
117k
}
_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
200k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
200k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
200k
    } else {
133
200k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
200k
    }
135
200k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
32
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
32
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
32
    } else {
133
32
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
32
    }
135
32
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.19k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.19k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
7.19k
    } else {
133
7.19k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.19k
    }
135
7.19k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.02k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.02k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
7.01k
    } else {
133
7.01k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.01k
    }
135
7.02k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
86.7k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
86.7k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
86.7k
    } else {
133
86.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
86.7k
    }
135
86.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
104k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
104k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
104k
    } else {
133
104k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
104k
    }
135
104k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
186
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
186
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
186
    } else {
133
186
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
186
    }
135
186
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
21
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
21
    if (_parent->nereids_id() == -1) {
131
21
        return fmt::format("(id={})", _parent->node_id());
132
21
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
21
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
10.1k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
10.1k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
10.1k
    } else {
133
10.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
10.1k
    }
135
10.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
539
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
539
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
437
    } else {
133
437
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
437
    }
135
539
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.9k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.9k
    if (_parent->nereids_id() == -1) {
131
12.9k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
242k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
242k
    if (_parent->nereids_id() == -1) {
131
242k
        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
242k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
465k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
465k
    if (_parent->nereids_id() == -1) {
131
465k
        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
465k
}
_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
337
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
337
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
337
    } else {
133
337
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
337
    }
135
337
}
136
137
template <typename SharedStateArg>
138
29.5k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.5k
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
29.5k
    _terminated = true;
143
29.5k
    return Status::OK();
144
29.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2.06k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.06k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.06k
    _terminated = true;
143
2.06k
    return Status::OK();
144
2.06k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1
    _terminated = true;
143
1
    return Status::OK();
144
1
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.39k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.39k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.39k
    _terminated = true;
143
1.39k
    return Status::OK();
144
1.39k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
735
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
735
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
735
    _terminated = true;
143
735
    return Status::OK();
144
735
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
275
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
275
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
274
    _terminated = true;
143
274
    return Status::OK();
144
275
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
293
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
293
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
293
    _terminated = true;
143
293
    return Status::OK();
144
293
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
242
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
242
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
242
    _terminated = true;
143
242
    return Status::OK();
144
242
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
7
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
7
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
7
    _terminated = true;
143
7
    return Status::OK();
144
7
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
321
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
321
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
321
    _terminated = true;
143
321
    return Status::OK();
144
321
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
137
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
137
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
137
    _terminated = true;
143
137
    return Status::OK();
144
137
}
145
146
303k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
303k
    return _child && _child->is_serial_operator() && !is_source()
148
303k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
303k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
303k
}
151
152
25.9k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
25.9k
    if (!_child) {
154
24.5k
        return false;
155
24.5k
    }
156
1.31k
    if (_child->is_serial_operator()) {
157
189
        return true;
158
189
    }
159
1.12k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.12k
    return child_distribution.need_local_exchange() &&
161
1.12k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.31k
}
163
164
template <typename SharedStateArg>
165
20.2k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
20.2k
    fmt::memory_buffer debug_string_buffer;
167
20.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
20.2k
    return fmt::to_string(debug_string_buffer);
169
20.2k
}
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
20.2k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
20.2k
    fmt::memory_buffer debug_string_buffer;
167
20.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
20.2k
    return fmt::to_string(debug_string_buffer);
169
20.2k
}
_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
20.2k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
20.2k
    fmt::memory_buffer debug_string_buffer;
174
20.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
20.2k
    return fmt::to_string(debug_string_buffer);
176
20.2k
}
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
20.2k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
20.2k
    fmt::memory_buffer debug_string_buffer;
174
20.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
20.2k
    return fmt::to_string(debug_string_buffer);
176
20.2k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
20.3k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
20.3k
    fmt::memory_buffer debug_string_buffer;
180
20.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
20.3k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
20.3k
                   _is_serial_operator);
183
20.3k
    return fmt::to_string(debug_string_buffer);
184
20.3k
}
185
186
20.2k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
20.2k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
20.2k
}
189
190
642k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
642k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
642k
    _nereids_id = tnode.nereids_id;
193
642k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.87k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.87k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.87k
            tnode.intermediate_projections_list.size()) {
199
0
            return Status::InternalError(
200
0
                    "intermediate_output_tuple_id_list size:{} not match "
201
0
                    "intermediate_projections_list size:{}",
202
0
                    tnode.intermediate_output_tuple_id_list.size(),
203
0
                    tnode.intermediate_projections_list.size());
204
0
        }
205
3.87k
    }
206
642k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
642k
    _op_name = substr + "_OPERATOR";
208
209
642k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
642k
    } else if (tnode.__isset.conjuncts) {
212
273k
        for (const auto& conjunct : tnode.conjuncts) {
213
273k
            VExprContextSPtr context;
214
273k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
273k
            _conjuncts.emplace_back(context);
216
273k
        }
217
99.1k
    }
218
219
    // create the projections expr
220
642k
    if (tnode.__isset.projections) {
221
261k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
261k
    }
223
642k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.87k
        DCHECK(has_projection()) << "no final projections";
225
3.87k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.55k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.55k
            VExprContextSPtrs projections;
228
6.55k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.55k
            _projection->intermediate_projections.push_back(projections);
230
6.55k
        }
231
3.87k
    }
232
642k
    return Status::OK();
233
642k
}
234
235
669k
Status OperatorXBase::prepare(RuntimeState* state) {
236
669k
    for (auto& conjunct : _conjuncts) {
237
273k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
273k
    }
239
669k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
619k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
339k
            return a->execute_cost() < b->execute_cost();
242
339k
        });
243
619k
    };
244
245
669k
    if (has_projection()) {
246
260k
        auto& projection = *_projection;
247
267k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.55k
            const auto& input_row_desc =
249
6.55k
                    i == 0 ? operator_row_desc_before_projection()
250
6.55k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.55k
            RETURN_IF_ERROR(
252
6.55k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.55k
        }
254
260k
        const auto& final_projection_input_row_desc =
255
260k
                projection.intermediate_output_row_descriptors.empty()
256
260k
                        ? operator_row_desc_before_projection()
257
260k
                        : projection.intermediate_output_row_descriptors.back();
258
260k
        RETURN_IF_ERROR(
259
260k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
260k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
260k
                                                      projection.output_row_descriptor));
262
260k
    }
263
264
669k
    for (auto& conjunct : _conjuncts) {
265
273k
        RETURN_IF_ERROR(conjunct->open(state));
266
273k
    }
267
669k
    if (has_projection()) {
268
260k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
260k
        for (auto& projections : _projection->intermediate_projections) {
270
6.55k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.55k
        }
272
260k
    }
273
669k
    if (_child && !is_source()) {
274
89.2k
        RETURN_IF_ERROR(_child->prepare(state));
275
89.2k
    }
276
277
669k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
669k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
669k
    return Status::OK();
283
669k
}
284
285
6.23k
Status OperatorXBase::terminate(RuntimeState* state) {
286
6.23k
    if (_child && !is_source()) {
287
699
        RETURN_IF_ERROR(_child->terminate(state));
288
699
    }
289
6.23k
    auto result = state->get_local_state_result(operator_id());
290
6.23k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
6.23k
    return result.value()->terminate(state);
294
6.23k
}
295
296
5.01M
Status OperatorXBase::close(RuntimeState* state) {
297
5.01M
    if (_child && !is_source()) {
298
844k
        RETURN_IF_ERROR(_child->close(state));
299
844k
    }
300
5.01M
    auto result = state->get_local_state_result(operator_id());
301
5.01M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
5.01M
    return result.value()->close(state);
305
5.01M
}
306
307
292k
void PipelineXLocalStateBase::clear_origin_block() {
308
292k
    _origin_block.clear_column_data(
309
292k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
292k
}
311
312
976k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
976k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
976k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
976k
    return Status::OK();
317
976k
}
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
292k
                                     Block* output_block) const {
326
292k
    auto* local_state = state->get_local_state(operator_id());
327
292k
    SCOPED_TIMER(local_state->exec_time_counter());
328
292k
    SCOPED_TIMER(local_state->_projection_timer);
329
292k
    const size_t rows = origin_block->rows();
330
292k
    if (rows == 0) {
331
159k
        return Status::OK();
332
159k
    }
333
132k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
132k
    {
336
132k
        Block input_block = *origin_block;
337
338
132k
        ColumnsWithTypeAndName new_columns;
339
132k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.67k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.67k
            new_columns.resize(projections.size());
345
69.9k
            for (int i = 0; i < projections.size(); i++) {
346
66.3k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
66.3k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
66.3k
            }
355
3.66k
            Block tmp_block {new_columns};
356
3.66k
            input_block.swap(tmp_block);
357
3.66k
        }
358
359
132k
        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
132k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
132k
                output_block, _projection->output_row_descriptor);
368
132k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
132k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
132k
        Columns shared_columns(mutable_columns.size());
371
372
765k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
632k
            ColumnPtr column_ptr;
374
632k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
632k
            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
632k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
632k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
632k
            if (column_ptr->is_exclusive()) {
386
230k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
402k
            } else {
388
402k
                shared_columns[i] = std::move(column_ptr);
389
402k
            }
390
632k
        }
391
392
132k
        scoped_mutable_block.restore();
393
765k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
632k
            if (shared_columns[i]) {
395
402k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
402k
            }
397
632k
        }
398
132k
    }
399
400
0
    origin_block->clear_column_data(
401
132k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
132k
    DCHECK_EQ(output_block->rows(), rows);
403
404
132k
    return Status::OK();
405
132k
}
406
407
4.57M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.57M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.57M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.57M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.57M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.57M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.57M
            if (_debug_point_count++ % 2 == 0) {
414
4.57M
                return Status::OK();
415
4.57M
            }
416
4.57M
        }
417
4.57M
    });
418
419
4.57M
    Status status;
420
4.57M
    auto* local_state = state->get_local_state(operator_id());
421
4.57M
    Defer defer([&]() {
422
4.57M
        if (status.ok()) {
423
4.57M
            local_state->update_output_block_counters(*block);
424
4.57M
        }
425
4.57M
    });
426
4.57M
    if (has_projection()) {
427
292k
        local_state->clear_origin_block();
428
292k
        status = get_block(state, &local_state->_origin_block, eos);
429
292k
        if (UNLIKELY(!status.ok())) {
430
24
            return status;
431
24
        }
432
292k
        status = do_projections(state, &local_state->_origin_block, block);
433
292k
        return status;
434
292k
    }
435
4.28M
    status = get_block(state, block, eos);
436
4.28M
    RETURN_IF_ERROR(block->check_type_and_column());
437
4.28M
    return status;
438
4.28M
}
439
440
2.94M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.94M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.59k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.59k
        *eos = true;
444
9.59k
    }
445
446
2.94M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.94M
        auto op_name = to_lower(_parent->_op_name);
448
2.94M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.94M
        arg_op_name = to_lower(arg_op_name);
450
451
2.94M
        if (op_name == arg_op_name) {
452
2.94M
            *eos = true;
453
2.94M
        }
454
2.94M
    });
455
456
2.94M
    if (auto rows = block->rows()) {
457
758k
        _num_rows_returned += rows;
458
758k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
758k
    }
460
2.94M
}
461
462
29.5k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
29.5k
    auto result = state->get_sink_local_state_result();
464
29.5k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
29.5k
    return result.value()->terminate(state);
468
29.5k
}
469
470
20.2k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
20.2k
    fmt::memory_buffer debug_string_buffer;
472
473
20.2k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
20.2k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
20.2k
    return fmt::to_string(debug_string_buffer);
476
20.2k
}
477
478
20.2k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
20.2k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
20.2k
}
481
482
336k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
336k
    std::string op_name = "UNKNOWN_SINK";
484
336k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
337k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
337k
        op_name = it->second;
488
337k
    }
489
336k
    _name = op_name + "_OPERATOR";
490
336k
    return Status::OK();
491
336k
}
492
493
290k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
290k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
290k
    _nereids_id = tnode.nereids_id;
496
290k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
290k
    _name = substr + "_SINK_OPERATOR";
498
290k
    return Status::OK();
499
290k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.76M
                                                            LocalSinkStateInfo& info) {
504
1.76M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.76M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.76M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.76M
    return Status::OK();
508
1.76M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
118k
                                                            LocalSinkStateInfo& info) {
504
118k
    auto local_state = LocalStateType::create_unique(this, state);
505
118k
    RETURN_IF_ERROR(local_state->init(state, info));
506
118k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
118k
    return Status::OK();
508
118k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
419k
                                                            LocalSinkStateInfo& info) {
504
419k
    auto local_state = LocalStateType::create_unique(this, state);
505
419k
    RETURN_IF_ERROR(local_state->init(state, info));
506
419k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
419k
    return Status::OK();
508
419k
}
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
378
                                                            LocalSinkStateInfo& info) {
504
378
    auto local_state = LocalStateType::create_unique(this, state);
505
378
    RETURN_IF_ERROR(local_state->init(state, info));
506
378
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
378
    return Status::OK();
508
378
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
47.1k
                                                            LocalSinkStateInfo& info) {
504
47.1k
    auto local_state = LocalStateType::create_unique(this, state);
505
47.1k
    RETURN_IF_ERROR(local_state->init(state, info));
506
47.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
47.1k
    return Status::OK();
508
47.1k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_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
}
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
7.02k
                                                            LocalSinkStateInfo& info) {
504
7.02k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.02k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.02k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.02k
    return Status::OK();
508
7.02k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
18
                                                            LocalSinkStateInfo& info) {
504
18
    auto local_state = LocalStateType::create_unique(this, state);
505
18
    RETURN_IF_ERROR(local_state->init(state, info));
506
18
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
18
    return Status::OK();
508
18
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
201k
                                                            LocalSinkStateInfo& info) {
504
201k
    auto local_state = LocalStateType::create_unique(this, state);
505
201k
    RETURN_IF_ERROR(local_state->init(state, info));
506
201k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
201k
    return Status::OK();
508
201k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
32
                                                            LocalSinkStateInfo& info) {
504
32
    auto local_state = LocalStateType::create_unique(this, state);
505
32
    RETURN_IF_ERROR(local_state->init(state, info));
506
32
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
32
    return Status::OK();
508
32
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
243k
                                                            LocalSinkStateInfo& info) {
504
243k
    auto local_state = LocalStateType::create_unique(this, state);
505
243k
    RETURN_IF_ERROR(local_state->init(state, info));
506
243k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
243k
    return Status::OK();
508
243k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
86.9k
                                                            LocalSinkStateInfo& info) {
504
86.9k
    auto local_state = LocalStateType::create_unique(this, state);
505
86.9k
    RETURN_IF_ERROR(local_state->init(state, info));
506
86.9k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
86.9k
    return Status::OK();
508
86.9k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
104k
                                                            LocalSinkStateInfo& info) {
504
104k
    auto local_state = LocalStateType::create_unique(this, state);
505
104k
    RETURN_IF_ERROR(local_state->init(state, info));
506
104k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
104k
    return Status::OK();
508
104k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
186
                                                            LocalSinkStateInfo& info) {
504
186
    auto local_state = LocalStateType::create_unique(this, state);
505
186
    RETURN_IF_ERROR(local_state->init(state, info));
506
186
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
186
    return Status::OK();
508
186
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
499k
                                                            LocalSinkStateInfo& info) {
504
499k
    auto local_state = LocalStateType::create_unique(this, state);
505
499k
    RETURN_IF_ERROR(local_state->init(state, info));
506
499k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
499k
    return Status::OK();
508
499k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7.19k
                                                            LocalSinkStateInfo& info) {
504
7.19k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.19k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.19k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.19k
    return Status::OK();
508
7.19k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
10.1k
                                                            LocalSinkStateInfo& info) {
504
10.1k
    auto local_state = LocalStateType::create_unique(this, state);
505
10.1k
    RETURN_IF_ERROR(local_state->init(state, info));
506
10.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
10.1k
    return Status::OK();
508
10.1k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1.99k
                                                            LocalSinkStateInfo& info) {
504
1.99k
    auto local_state = LocalStateType::create_unique(this, state);
505
1.99k
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.99k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.99k
    return Status::OK();
508
1.99k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
436
                                                            LocalSinkStateInfo& info) {
504
436
    auto local_state = LocalStateType::create_unique(this, state);
505
436
    RETURN_IF_ERROR(local_state->init(state, info));
506
436
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
436
    return Status::OK();
508
436
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.95k
                                                            LocalSinkStateInfo& info) {
504
4.95k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.95k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.95k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.95k
    return Status::OK();
508
4.95k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.72k
                                                            LocalSinkStateInfo& info) {
504
2.72k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.72k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.72k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.72k
    return Status::OK();
508
2.72k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.66k
                                                            LocalSinkStateInfo& info) {
504
2.66k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.66k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.66k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.66k
    return Status::OK();
508
2.66k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.56k
                                                            LocalSinkStateInfo& info) {
504
2.56k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.56k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.56k
    return Status::OK();
508
2.56k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
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
106
                                                            LocalSinkStateInfo& info) {
504
106
    auto local_state = LocalStateType::create_unique(this, state);
505
106
    RETURN_IF_ERROR(local_state->init(state, info));
506
106
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
106
    return Status::OK();
508
106
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
509
510
template <typename LocalStateType>
511
1.38M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
0
                                 LocalExchangeSharedState>) {
514
0
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
0
                                        MultiCastSharedState>) {
517
0
        throw Exception(Status::FatalError("should not reach here!"));
518
1.38M
    } else {
519
1.38M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.38M
        ss->id = operator_id();
521
1.38M
        for (auto& dest : dests_id()) {
522
1.37M
            ss->related_op_ids.insert(dest);
523
1.37M
        }
524
1.38M
        return ss;
525
1.38M
    }
526
1.38M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
105k
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
105k
    } else {
519
105k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
105k
        ss->id = operator_id();
521
105k
        for (auto& dest : dests_id()) {
522
105k
            ss->related_op_ids.insert(dest);
523
105k
        }
524
105k
        return ss;
525
105k
    }
526
105k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
419k
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
419k
    } else {
519
419k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
419k
        ss->id = operator_id();
521
419k
        for (auto& dest : dests_id()) {
522
418k
            ss->related_op_ids.insert(dest);
523
418k
        }
524
419k
        return ss;
525
419k
    }
526
419k
}
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
376
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
376
    } else {
519
376
        auto ss = LocalStateType::SharedStateType::create_shared();
520
376
        ss->id = operator_id();
521
376
        for (auto& dest : dests_id()) {
522
373
            ss->related_op_ids.insert(dest);
523
373
        }
524
376
        return ss;
525
376
    }
526
376
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
47.2k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
47.2k
    } else {
519
47.2k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
47.2k
        ss->id = operator_id();
521
47.2k
        for (auto& dest : dests_id()) {
522
46.7k
            ss->related_op_ids.insert(dest);
523
46.7k
        }
524
47.2k
        return ss;
525
47.2k
    }
526
47.2k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
40
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
40
    } else {
519
40
        auto ss = LocalStateType::SharedStateType::create_shared();
520
40
        ss->id = operator_id();
521
40
        for (auto& dest : dests_id()) {
522
40
            ss->related_op_ids.insert(dest);
523
40
        }
524
40
        return ss;
525
40
    }
526
40
}
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
7.08k
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
7.08k
    } else {
519
7.08k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7.08k
        ss->id = operator_id();
521
7.08k
        for (auto& dest : dests_id()) {
522
7.07k
            ss->related_op_ids.insert(dest);
523
7.07k
        }
524
7.08k
        return ss;
525
7.08k
    }
526
7.08k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
18
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
18
    } else {
519
18
        auto ss = LocalStateType::SharedStateType::create_shared();
520
18
        ss->id = operator_id();
521
18
        for (auto& dest : dests_id()) {
522
18
            ss->related_op_ids.insert(dest);
523
18
        }
524
18
        return ss;
525
18
    }
526
18
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
201k
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
201k
    } else {
519
201k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
201k
        ss->id = operator_id();
521
201k
        for (auto& dest : dests_id()) {
522
201k
            ss->related_op_ids.insert(dest);
523
201k
        }
524
201k
        return ss;
525
201k
    }
526
201k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
34
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
34
    } else {
519
34
        auto ss = LocalStateType::SharedStateType::create_shared();
520
34
        ss->id = operator_id();
521
34
        for (auto& dest : dests_id()) {
522
34
            ss->related_op_ids.insert(dest);
523
34
        }
524
34
        return ss;
525
34
    }
526
34
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
87.1k
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
87.1k
    } else {
519
87.1k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
87.1k
        ss->id = operator_id();
521
87.2k
        for (auto& dest : dests_id()) {
522
87.2k
            ss->related_op_ids.insert(dest);
523
87.2k
        }
524
87.1k
        return ss;
525
87.1k
    }
526
87.1k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
185
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
185
    } else {
519
185
        auto ss = LocalStateType::SharedStateType::create_shared();
520
185
        ss->id = operator_id();
521
185
        for (auto& dest : dests_id()) {
522
185
            ss->related_op_ids.insert(dest);
523
185
        }
524
185
        return ss;
525
185
    }
526
185
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
500k
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
500k
    } else {
519
500k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
500k
        ss->id = operator_id();
521
500k
        for (auto& dest : dests_id()) {
522
494k
            ss->related_op_ids.insert(dest);
523
494k
        }
524
500k
        return ss;
525
500k
    }
526
500k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
7.20k
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
7.20k
    } else {
519
7.20k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7.20k
        ss->id = operator_id();
521
7.20k
        for (auto& dest : dests_id()) {
522
7.19k
            ss->related_op_ids.insert(dest);
523
7.19k
        }
524
7.20k
        return ss;
525
7.20k
    }
526
7.20k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
536
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
536
    } else {
519
536
        auto ss = LocalStateType::SharedStateType::create_shared();
520
536
        ss->id = operator_id();
521
536
        for (auto& dest : dests_id()) {
522
535
            ss->related_op_ids.insert(dest);
523
535
        }
524
536
        return ss;
525
536
    }
526
536
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.64k
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.64k
    } else {
519
2.64k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.64k
        ss->id = operator_id();
521
2.65k
        for (auto& dest : dests_id()) {
522
2.65k
            ss->related_op_ids.insert(dest);
523
2.65k
        }
524
2.64k
        return ss;
525
2.64k
    }
526
2.64k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.55k
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.55k
    } else {
519
2.55k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.55k
        ss->id = operator_id();
521
2.55k
        for (auto& dest : dests_id()) {
522
2.54k
            ss->related_op_ids.insert(dest);
523
2.54k
        }
524
2.55k
        return ss;
525
2.55k
    }
526
2.55k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
569
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
569
    } else {
519
569
        auto ss = LocalStateType::SharedStateType::create_shared();
520
569
        ss->id = operator_id();
521
569
        for (auto& dest : dests_id()) {
522
564
            ss->related_op_ids.insert(dest);
523
564
        }
524
569
        return ss;
525
569
    }
526
569
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
106
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
106
    } else {
519
106
        auto ss = LocalStateType::SharedStateType::create_shared();
520
106
        ss->id = operator_id();
521
106
        for (auto& dest : dests_id()) {
522
104
            ss->related_op_ids.insert(dest);
523
104
        }
524
106
        return ss;
525
106
    }
526
106
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
2.11M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.11M
    auto local_state = LocalStateType::create_unique(state, this);
531
2.11M
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.11M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.11M
    return Status::OK();
534
2.11M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
69.9k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
69.9k
    auto local_state = LocalStateType::create_unique(state, this);
531
69.9k
    RETURN_IF_ERROR(local_state->init(state, info));
532
69.9k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
69.9k
    return Status::OK();
534
69.9k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
242k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
242k
    auto local_state = LocalStateType::create_unique(state, this);
531
242k
    RETURN_IF_ERROR(local_state->init(state, info));
532
242k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
242k
    return Status::OK();
534
242k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
135
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
135
    auto local_state = LocalStateType::create_unique(state, this);
531
135
    RETURN_IF_ERROR(local_state->init(state, info));
532
135
    state->emplace_local_state(operator_id(), std::move(local_state));
533
135
    return Status::OK();
534
135
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.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
7.01k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.01k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.01k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.01k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.01k
    return Status::OK();
534
7.01k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.86k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.86k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.86k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.86k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.86k
    return Status::OK();
534
6.86k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
25
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
25
    auto local_state = LocalStateType::create_unique(state, this);
531
25
    RETURN_IF_ERROR(local_state->init(state, info));
532
25
    state->emplace_local_state(operator_id(), std::move(local_state));
533
25
    return Status::OK();
534
25
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
193k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
193k
    auto local_state = LocalStateType::create_unique(state, this);
531
193k
    RETURN_IF_ERROR(local_state->init(state, info));
532
193k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
193k
    return Status::OK();
534
193k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
86.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
86.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
86.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
86.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
86.8k
    return Status::OK();
534
86.8k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
105k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
105k
    auto local_state = LocalStateType::create_unique(state, this);
531
105k
    RETURN_IF_ERROR(local_state->init(state, info));
532
105k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
105k
    return Status::OK();
534
105k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
176
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
176
    auto local_state = LocalStateType::create_unique(state, this);
531
176
    RETURN_IF_ERROR(local_state->init(state, info));
532
176
    state->emplace_local_state(operator_id(), std::move(local_state));
533
176
    return Status::OK();
534
176
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.93k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.93k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.93k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.93k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.93k
    return Status::OK();
534
4.93k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
295k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
295k
    auto local_state = LocalStateType::create_unique(state, this);
531
295k
    RETURN_IF_ERROR(local_state->init(state, info));
532
295k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
295k
    return Status::OK();
534
295k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.22k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.22k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.22k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.22k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.22k
    return Status::OK();
534
1.22k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.19k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.19k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.19k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.19k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.19k
    return Status::OK();
534
7.19k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
27
    auto local_state = LocalStateType::create_unique(state, this);
531
27
    RETURN_IF_ERROR(local_state->init(state, info));
532
27
    state->emplace_local_state(operator_id(), std::move(local_state));
533
27
    return Status::OK();
534
27
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
54.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.2k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.2k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.2k
    return Status::OK();
534
54.2k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.11k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.11k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.11k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.11k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.11k
    return Status::OK();
534
5.11k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
435
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
435
    auto local_state = LocalStateType::create_unique(state, this);
531
435
    RETURN_IF_ERROR(local_state->init(state, info));
532
435
    state->emplace_local_state(operator_id(), std::move(local_state));
533
435
    return Status::OK();
534
435
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.67k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.67k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.67k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.67k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.67k
    return Status::OK();
534
2.67k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.57k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.57k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.57k
    return Status::OK();
534
2.57k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
314
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
314
    auto local_state = LocalStateType::create_unique(state, this);
531
314
    RETURN_IF_ERROR(local_state->init(state, info));
532
314
    state->emplace_local_state(operator_id(), std::move(local_state));
533
314
    return Status::OK();
534
314
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.3k
    return Status::OK();
534
10.3k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
669k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
669k
    auto local_state = LocalStateType::create_unique(state, this);
531
669k
    RETURN_IF_ERROR(local_state->init(state, info));
532
669k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
669k
    return Status::OK();
534
669k
}
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
168
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
168
    auto local_state = LocalStateType::create_unique(state, this);
531
168
    RETURN_IF_ERROR(local_state->init(state, info));
532
168
    state->emplace_local_state(operator_id(), std::move(local_state));
533
168
    return Status::OK();
534
168
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.20k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.20k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.20k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.20k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.20k
    return Status::OK();
534
2.20k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
787
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
787
    auto local_state = LocalStateType::create_unique(state, this);
531
787
    RETURN_IF_ERROR(local_state->init(state, info));
532
787
    state->emplace_local_state(operator_id(), std::move(local_state));
533
787
    return Status::OK();
534
787
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.09k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.09k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.09k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.09k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.09k
    return Status::OK();
534
1.09k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.00k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.00k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.00k
    return Status::OK();
534
7.00k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
326k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
326k
    auto local_state = LocalStateType::create_unique(state, this);
531
326k
    RETURN_IF_ERROR(local_state->init(state, info));
532
326k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
326k
    return Status::OK();
534
326k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.75M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
2.10M
        : _num_rows_returned(0),
542
2.10M
          _rows_returned_counter(nullptr),
543
2.10M
          _parent(parent),
544
2.10M
          _state(state),
545
2.10M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
2.11M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
2.11M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
2.11M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
2.11M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
2.11M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
2.11M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
2.11M
    _operator_profile->add_child(_common_profile.get(), true);
557
2.11M
    _operator_profile->add_child(_custom_profile.get(), true);
558
2.11M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
2.11M
    if constexpr (!is_fake_shared) {
560
1.21M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
781k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
781k
                                    .first.get()
563
781k
                                    ->template cast<SharedStateArg>();
564
565
781k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
781k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
781k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
781k
        } else if (info.shared_state) {
569
368k
            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
368k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
368k
            _dependency = _shared_state->create_source_dependency(
576
368k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
368k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
368k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
368k
        } else {
580
64.0k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
6.79k
                DCHECK(false);
582
6.79k
            }
583
64.0k
        }
584
1.21M
    }
585
586
2.11M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
2.11M
    _rows_returned_counter =
591
2.11M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
2.11M
    _blocks_returned_counter =
593
2.11M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
2.11M
    _output_block_bytes_counter =
595
2.11M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
2.11M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
2.11M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
2.11M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
2.11M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
2.11M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
2.11M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
2.11M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
2.11M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
2.11M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
2.11M
    _memory_used_counter =
606
2.11M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
2.11M
    _common_profile->add_info_string("IsColocate",
608
2.11M
                                     std::to_string(_parent->is_colocated_operator()));
609
2.11M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
2.11M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
2.11M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
2.11M
    return Status::OK();
613
2.11M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
70.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
70.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
70.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
70.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
70.0k
    _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
70.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
70.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
70.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
70.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
70.0k
    if constexpr (!is_fake_shared) {
560
70.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
12.0k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
12.0k
                                    .first.get()
563
12.0k
                                    ->template cast<SharedStateArg>();
564
565
12.0k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
12.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
12.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
58.0k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
57.3k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
57.3k
            _dependency = _shared_state->create_source_dependency(
576
57.3k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
57.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
57.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
57.3k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
602
        }
584
70.0k
    }
585
586
70.0k
    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
70.0k
    _rows_returned_counter =
591
70.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
70.0k
    _blocks_returned_counter =
593
70.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
70.0k
    _output_block_bytes_counter =
595
70.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
70.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
70.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
70.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
70.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
70.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
70.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
70.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
70.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
70.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
70.0k
    _memory_used_counter =
606
70.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
70.0k
    _common_profile->add_info_string("IsColocate",
608
70.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
70.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
70.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
70.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
70.0k
    return Status::OK();
613
70.0k
}
_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
201k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
201k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
201k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
201k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
201k
    _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
201k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
201k
    _operator_profile->add_child(_common_profile.get(), true);
557
201k
    _operator_profile->add_child(_custom_profile.get(), true);
558
201k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
201k
    if constexpr (!is_fake_shared) {
560
201k
        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
201k
        } 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
195k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
195k
            _dependency = _shared_state->create_source_dependency(
576
195k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
195k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
195k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
195k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
5.47k
        }
584
201k
    }
585
586
201k
    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
201k
    _rows_returned_counter =
591
201k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
201k
    _blocks_returned_counter =
593
201k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
201k
    _output_block_bytes_counter =
595
201k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
201k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
201k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
201k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
201k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
201k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
201k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
201k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
201k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
201k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
201k
    _memory_used_counter =
606
201k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
201k
    _common_profile->add_info_string("IsColocate",
608
201k
                                     std::to_string(_parent->is_colocated_operator()));
609
201k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
201k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
201k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
201k
    return Status::OK();
613
201k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
25
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
25
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
25
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
25
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
25
    _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
25
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
25
    _operator_profile->add_child(_common_profile.get(), true);
557
25
    _operator_profile->add_child(_custom_profile.get(), true);
558
25
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
25
    if constexpr (!is_fake_shared) {
560
25
        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
25
        } 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
25
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
25
            _dependency = _shared_state->create_source_dependency(
576
25
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
25
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
25
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
25
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
25
    }
585
586
25
    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
25
    _rows_returned_counter =
591
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
25
    _blocks_returned_counter =
593
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
25
    _output_block_bytes_counter =
595
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
25
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
25
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
25
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
25
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
25
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
25
    _memory_used_counter =
606
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
25
    _common_profile->add_info_string("IsColocate",
608
25
                                     std::to_string(_parent->is_colocated_operator()));
609
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
25
    return Status::OK();
613
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
7.20k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
7.20k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
7.20k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
7.20k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
7.20k
    _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
7.20k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
7.20k
    _operator_profile->add_child(_common_profile.get(), true);
557
7.20k
    _operator_profile->add_child(_custom_profile.get(), true);
558
7.20k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
7.20k
    if constexpr (!is_fake_shared) {
560
7.20k
        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
7.20k
        } 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
7.18k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
7.18k
            _dependency = _shared_state->create_source_dependency(
576
7.18k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
7.18k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
7.18k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
7.18k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
21
        }
584
7.20k
    }
585
586
7.20k
    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
7.20k
    _rows_returned_counter =
591
7.20k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
7.20k
    _blocks_returned_counter =
593
7.20k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
7.20k
    _output_block_bytes_counter =
595
7.20k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.20k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
7.20k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
7.20k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
7.20k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
7.20k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
7.20k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
7.20k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
7.20k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
7.20k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
7.20k
    _memory_used_counter =
606
7.20k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
7.20k
    _common_profile->add_info_string("IsColocate",
608
7.20k
                                     std::to_string(_parent->is_colocated_operator()));
609
7.20k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
7.20k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
7.20k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
7.20k
    return Status::OK();
613
7.20k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
7.08k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
7.08k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
7.08k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
7.08k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
7.08k
    _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
7.08k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
7.08k
    _operator_profile->add_child(_common_profile.get(), true);
557
7.08k
    _operator_profile->add_child(_custom_profile.get(), true);
558
7.08k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
7.08k
    if constexpr (!is_fake_shared) {
560
7.08k
        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
7.08k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.99k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.99k
            _dependency = _shared_state->create_source_dependency(
576
6.99k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.99k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.99k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.99k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
96
        }
584
7.08k
    }
585
586
7.08k
    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
7.08k
    _rows_returned_counter =
591
7.08k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
7.08k
    _blocks_returned_counter =
593
7.08k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
7.08k
    _output_block_bytes_counter =
595
7.08k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.08k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
7.08k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
7.08k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
7.08k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
7.08k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
7.08k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
7.08k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
7.08k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
7.08k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
7.08k
    _memory_used_counter =
606
7.08k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
7.08k
    _common_profile->add_info_string("IsColocate",
608
7.08k
                                     std::to_string(_parent->is_colocated_operator()));
609
7.08k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
7.08k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
7.08k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
7.08k
    return Status::OK();
613
7.08k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
87.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
87.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
87.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
87.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
87.0k
    _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
87.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
87.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
87.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
87.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
87.0k
    if constexpr (!is_fake_shared) {
560
87.0k
        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
87.0k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
85.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
85.8k
            _dependency = _shared_state->create_source_dependency(
576
85.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
85.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
85.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
85.8k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.21k
        }
584
87.0k
    }
585
586
87.0k
    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
87.0k
    _rows_returned_counter =
591
87.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
87.0k
    _blocks_returned_counter =
593
87.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
87.0k
    _output_block_bytes_counter =
595
87.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
87.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
87.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
87.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
87.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
87.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
87.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
87.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
87.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
87.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
87.0k
    _memory_used_counter =
606
87.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
87.0k
    _common_profile->add_info_string("IsColocate",
608
87.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
87.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
87.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
87.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
87.0k
    return Status::OK();
613
87.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
104k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
104k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
104k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
104k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
104k
    _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
104k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
104k
    _operator_profile->add_child(_common_profile.get(), true);
557
104k
    _operator_profile->add_child(_custom_profile.get(), true);
558
104k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
104k
    if constexpr (!is_fake_shared) {
560
105k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
105k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
105k
                                    .first.get()
563
105k
                                    ->template cast<SharedStateArg>();
564
565
105k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
105k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
105k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
104k
    }
585
586
104k
    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
104k
    _rows_returned_counter =
591
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
104k
    _blocks_returned_counter =
593
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
104k
    _output_block_bytes_counter =
595
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
104k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
104k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
104k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
104k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
104k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
104k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
104k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
104k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
104k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
104k
    _memory_used_counter =
606
104k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
104k
    _common_profile->add_info_string("IsColocate",
608
104k
                                     std::to_string(_parent->is_colocated_operator()));
609
104k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
104k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
104k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
104k
    return Status::OK();
613
104k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
176
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
176
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
176
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
176
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
176
    _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
176
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
176
    _operator_profile->add_child(_common_profile.get(), true);
557
176
    _operator_profile->add_child(_custom_profile.get(), true);
558
176
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
176
    if constexpr (!is_fake_shared) {
560
176
        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
176
        } 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
176
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
176
            _dependency = _shared_state->create_source_dependency(
576
176
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
176
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
176
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
176
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
176
    }
585
586
176
    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
176
    _rows_returned_counter =
591
176
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
176
    _blocks_returned_counter =
593
176
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
176
    _output_block_bytes_counter =
595
176
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
176
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
176
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
176
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
176
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
176
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
176
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
176
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
176
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
176
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
176
    _memory_used_counter =
606
176
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
176
    _common_profile->add_info_string("IsColocate",
608
176
                                     std::to_string(_parent->is_colocated_operator()));
609
176
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
176
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
176
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
176
    return Status::OK();
613
176
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
897k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
897k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
897k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
897k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
897k
    _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
897k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
897k
    _operator_profile->add_child(_common_profile.get(), true);
557
897k
    _operator_profile->add_child(_custom_profile.get(), true);
558
897k
    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
897k
    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
897k
    _rows_returned_counter =
591
897k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
897k
    _blocks_returned_counter =
593
897k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
897k
    _output_block_bytes_counter =
595
897k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
897k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
897k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
897k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
897k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
897k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
897k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
897k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
897k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
897k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
897k
    _memory_used_counter =
606
897k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
897k
    _common_profile->add_info_string("IsColocate",
608
897k
                                     std::to_string(_parent->is_colocated_operator()));
609
897k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
897k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
897k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
897k
    return Status::OK();
613
897k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.1k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.1k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.1k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.1k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.1k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
54.1k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.1k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.1k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.1k
    if constexpr (!is_fake_shared) {
560
54.1k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.1k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.27k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.27k
            _dependency = _shared_state->create_source_dependency(
576
4.27k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.27k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.27k
                    _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
49.8k
        }
584
54.1k
    }
585
586
54.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
54.1k
    _rows_returned_counter =
591
54.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.1k
    _blocks_returned_counter =
593
54.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.1k
    _output_block_bytes_counter =
595
54.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.1k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.1k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.1k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.1k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.1k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.1k
    _memory_used_counter =
606
54.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.1k
    _common_profile->add_info_string("IsColocate",
608
54.1k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.1k
    return Status::OK();
613
54.1k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.11k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.11k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.11k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.11k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.11k
    _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.11k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.11k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.11k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.11k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.11k
    if constexpr (!is_fake_shared) {
560
5.11k
        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.11k
        } 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.10k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.10k
            _dependency = _shared_state->create_source_dependency(
576
5.10k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.10k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.10k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.10k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
10
        }
584
5.11k
    }
585
586
5.11k
    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.11k
    _rows_returned_counter =
591
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.11k
    _blocks_returned_counter =
593
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.11k
    _output_block_bytes_counter =
595
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.11k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.11k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.11k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.11k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.11k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.11k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.11k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.11k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.11k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.11k
    _memory_used_counter =
606
5.11k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.11k
    _common_profile->add_info_string("IsColocate",
608
5.11k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.11k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.11k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.11k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.11k
    return Status::OK();
613
5.11k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
538
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
538
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
538
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
538
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
538
    _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
538
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
538
    _operator_profile->add_child(_common_profile.get(), true);
557
538
    _operator_profile->add_child(_custom_profile.get(), true);
558
538
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
538
    if constexpr (!is_fake_shared) {
560
538
        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
538
        } 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
537
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
537
            _dependency = _shared_state->create_source_dependency(
576
537
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
537
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
537
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
537
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
538
    }
585
586
538
    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
538
    _rows_returned_counter =
591
538
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
538
    _blocks_returned_counter =
593
538
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
538
    _output_block_bytes_counter =
595
538
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
538
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
538
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
538
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
538
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
538
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
538
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
538
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
538
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
538
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
538
    _memory_used_counter =
606
538
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
538
    _common_profile->add_info_string("IsColocate",
608
538
                                     std::to_string(_parent->is_colocated_operator()));
609
538
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
538
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
538
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
538
    return Status::OK();
613
538
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.28k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.28k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.28k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.28k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.28k
    _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.28k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.28k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.28k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.28k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.28k
    if constexpr (!is_fake_shared) {
560
5.28k
        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.28k
        } 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.23k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.23k
            _dependency = _shared_state->create_source_dependency(
576
5.23k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.23k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.23k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.23k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
53
        }
584
5.28k
    }
585
586
5.28k
    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.28k
    _rows_returned_counter =
591
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.28k
    _blocks_returned_counter =
593
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.28k
    _output_block_bytes_counter =
595
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.28k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.28k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.28k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.28k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.28k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.28k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.28k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.28k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.28k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.28k
    _memory_used_counter =
606
5.28k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.28k
    _common_profile->add_info_string("IsColocate",
608
5.28k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.28k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.28k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.28k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.28k
    return Status::OK();
613
5.28k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
671k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
671k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
671k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
671k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
671k
    _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
671k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
671k
    _operator_profile->add_child(_common_profile.get(), true);
557
671k
    _operator_profile->add_child(_custom_profile.get(), true);
558
671k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
671k
    if constexpr (!is_fake_shared) {
560
671k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
664k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
664k
                                    .first.get()
563
664k
                                    ->template cast<SharedStateArg>();
564
565
664k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
664k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
664k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
664k
        } 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.79k
        } else {
580
6.79k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
6.79k
                DCHECK(false);
582
6.79k
            }
583
6.79k
        }
584
671k
    }
585
586
671k
    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
671k
    _rows_returned_counter =
591
671k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
671k
    _blocks_returned_counter =
593
671k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
671k
    _output_block_bytes_counter =
595
671k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
671k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
671k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
671k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
671k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
671k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
671k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
671k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
671k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
671k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
671k
    _memory_used_counter =
606
671k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
671k
    _common_profile->add_info_string("IsColocate",
608
671k
                                     std::to_string(_parent->is_colocated_operator()));
609
671k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
671k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
671k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
671k
    return Status::OK();
613
671k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
168
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
168
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
168
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
168
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
168
    _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
168
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
168
    _operator_profile->add_child(_common_profile.get(), true);
557
168
    _operator_profile->add_child(_custom_profile.get(), true);
558
168
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
168
    if constexpr (!is_fake_shared) {
560
168
        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
168
        } 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
168
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
168
            _dependency = _shared_state->create_source_dependency(
576
168
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
168
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
168
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
168
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
168
    }
585
586
168
    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
168
    _rows_returned_counter =
591
168
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
168
    _blocks_returned_counter =
593
168
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
168
    _output_block_bytes_counter =
595
168
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
168
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
168
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
168
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
168
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
168
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
168
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
168
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
168
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
168
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
168
    _memory_used_counter =
606
168
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
168
    _common_profile->add_info_string("IsColocate",
608
168
                                     std::to_string(_parent->is_colocated_operator()));
609
168
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
168
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
168
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
168
    return Status::OK();
613
168
}
614
615
template <typename SharedStateArg>
616
2.12M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.12M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.42M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
303k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
303k
    }
621
2.12M
    if (_parent->has_projection()) {
622
382k
        const auto& projection = *_parent->_projection;
623
382k
        _projections.resize(projection.projections.size());
624
2.36M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.98M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.98M
        }
627
382k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
397k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
14.9k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
214k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
199k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
199k
                        state, _intermediate_projections[i][j]));
633
199k
            }
634
14.9k
        }
635
382k
    }
636
2.12M
    return Status::OK();
637
2.12M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
70.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
70.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
72.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.93k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.93k
    }
621
70.3k
    if (_parent->has_projection()) {
622
70.3k
        const auto& projection = *_parent->_projection;
623
70.3k
        _projections.resize(projection.projections.size());
624
376k
        for (size_t i = 0; i < _projections.size(); i++) {
625
305k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
305k
        }
627
70.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
77.2k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.86k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
162k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
155k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
155k
                        state, _intermediate_projections[i][j]));
633
155k
            }
634
6.86k
        }
635
70.3k
    }
636
70.3k
    return Status::OK();
637
70.3k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
3
    _conjuncts.resize(_parent->_conjuncts.size());
618
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
3
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
3
    return Status::OK();
637
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
202k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
202k
    _conjuncts.resize(_parent->_conjuncts.size());
618
202k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
202k
    if (_parent->has_projection()) {
622
79
        const auto& projection = *_parent->_projection;
623
79
        _projections.resize(projection.projections.size());
624
400
        for (size_t i = 0; i < _projections.size(); i++) {
625
321
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
321
        }
627
79
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
79
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
79
    }
636
202k
    return Status::OK();
637
202k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_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_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
7.19k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
7.19k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.33k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
141
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
141
    }
621
7.20k
    if (_parent->has_projection()) {
622
7.20k
        const auto& projection = *_parent->_projection;
623
7.20k
        _projections.resize(projection.projections.size());
624
32.3k
        for (size_t i = 0; i < _projections.size(); i++) {
625
25.1k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
25.1k
        }
627
7.20k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
7.24k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
46
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
316
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
270
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
270
                        state, _intermediate_projections[i][j]));
633
270
            }
634
46
        }
635
7.20k
    }
636
7.19k
    return Status::OK();
637
7.19k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
7.10k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
7.10k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.96k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
861
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
861
    }
621
7.10k
    if (_parent->has_projection()) {
622
3.74k
        const auto& projection = *_parent->_projection;
623
3.74k
        _projections.resize(projection.projections.size());
624
15.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
12.0k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
12.0k
        }
627
3.74k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
3.82k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
85
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
639
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
554
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
554
                        state, _intermediate_projections[i][j]));
633
554
            }
634
85
        }
635
3.74k
    }
636
7.10k
    return Status::OK();
637
7.10k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
87.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
87.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
89.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.75k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.75k
    }
621
87.3k
    if (_parent->has_projection()) {
622
30.0k
        const auto& projection = *_parent->_projection;
623
30.0k
        _projections.resize(projection.projections.size());
624
277k
        for (size_t i = 0; i < _projections.size(); i++) {
625
247k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
247k
        }
627
30.0k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
30.2k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
186
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.32k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
1.13k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
1.13k
                        state, _intermediate_projections[i][j]));
633
1.13k
            }
634
186
        }
635
30.0k
    }
636
87.3k
    return Status::OK();
637
87.3k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
105k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
105k
    _conjuncts.resize(_parent->_conjuncts.size());
618
105k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
105k
    if (_parent->has_projection()) {
622
174
        const auto& projection = *_parent->_projection;
623
174
        _projections.resize(projection.projections.size());
624
708
        for (size_t i = 0; i < _projections.size(); i++) {
625
534
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
534
        }
627
174
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
174
        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
174
    }
636
105k
    return Status::OK();
637
105k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
180
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
180
    _conjuncts.resize(_parent->_conjuncts.size());
618
180
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
180
    if (_parent->has_projection()) {
622
162
        const auto& projection = *_parent->_projection;
623
162
        _projections.resize(projection.projections.size());
624
486
        for (size_t i = 0; i < _projections.size(); i++) {
625
324
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
324
        }
627
162
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
162
        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
162
    }
636
180
    return Status::OK();
637
180
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
901k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
901k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.19M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
298k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
298k
    }
621
901k
    if (_parent->has_projection()) {
622
259k
        const auto& projection = *_parent->_projection;
623
259k
        _projections.resize(projection.projections.size());
624
1.55M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.29M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.29M
        }
627
259k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
266k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.69k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
47.4k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
39.7k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
39.7k
                        state, _intermediate_projections[i][j]));
633
39.7k
            }
634
7.69k
        }
635
259k
    }
636
901k
    return Status::OK();
637
901k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
54.4k
    if (_parent->has_projection()) {
622
11.2k
        const auto& projection = *_parent->_projection;
623
11.2k
        _projections.resize(projection.projections.size());
624
110k
        for (size_t i = 0; i < _projections.size(); i++) {
625
98.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
98.7k
        }
627
11.2k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.3k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
118
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
2.39k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
2.27k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
2.27k
                        state, _intermediate_projections[i][j]));
633
2.27k
            }
634
118
        }
635
11.2k
    }
636
54.4k
    return Status::OK();
637
54.4k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.10k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.10k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.01k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
907
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
907
    }
621
5.10k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
5.10k
    return Status::OK();
637
5.10k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
539
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
539
    _conjuncts.resize(_parent->_conjuncts.size());
618
539
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
539
    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
539
    return Status::OK();
637
539
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.29k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.29k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.29k
    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.29k
    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.29k
    return Status::OK();
637
5.29k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
675k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
675k
    _conjuncts.resize(_parent->_conjuncts.size());
618
675k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
675k
    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
675k
    return Status::OK();
637
675k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
169
    _conjuncts.resize(_parent->_conjuncts.size());
618
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
169
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
491
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
166
    }
636
169
    return Status::OK();
637
169
}
638
639
template <typename SharedStateArg>
640
6.23k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.23k
    if (_terminated) {
642
2
        return Status::OK();
643
2
    }
644
6.23k
    _terminated = true;
645
6.23k
    return Status::OK();
646
6.23k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
354
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
354
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
354
    _terminated = true;
645
354
    return Status::OK();
646
354
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_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_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
18
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
18
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
18
    _terminated = true;
645
18
    return Status::OK();
646
18
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
40
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
40
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
40
    _terminated = true;
645
40
    return Status::OK();
646
40
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1
    _terminated = true;
645
1
    return Status::OK();
646
1
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4.67k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4.67k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
4.67k
    _terminated = true;
645
4.67k
    return Status::OK();
646
4.67k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
37
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
37
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
37
    _terminated = true;
645
37
    return Status::OK();
646
37
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1
    _terminated = true;
645
1
    return Status::OK();
646
1
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
4
    _terminated = true;
645
4
    return Status::OK();
646
4
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.05k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.05k
    if (_terminated) {
642
1
        return Status::OK();
643
1
    }
644
1.04k
    _terminated = true;
645
1.04k
    return Status::OK();
646
1.05k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
35
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
35
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
35
    _terminated = true;
645
35
    return Status::OK();
646
35
}
647
648
template <typename SharedStateArg>
649
2.35M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.35M
    if (_closed) {
651
231k
        return Status::OK();
652
231k
    }
653
2.12M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.21M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.21M
    }
656
2.12M
    _closed = true;
657
2.12M
    return Status::OK();
658
2.35M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
70.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
70.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
70.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
70.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
70.2k
    }
656
70.2k
    _closed = true;
657
70.2k
    return Status::OK();
658
70.2k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4
    }
656
4
    _closed = true;
657
4
    return Status::OK();
658
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
401k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
401k
    if (_closed) {
651
201k
        return Status::OK();
652
201k
    }
653
199k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
199k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
199k
    }
656
199k
    _closed = true;
657
199k
    return Status::OK();
658
401k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
25
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
25
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
25
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
25
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
25
    }
656
25
    _closed = true;
657
25
    return Status::OK();
658
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
7.18k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
7.18k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
7.18k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
7.18k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
7.18k
    }
656
7.18k
    _closed = true;
657
7.18k
    return Status::OK();
658
7.18k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
14.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
14.3k
    if (_closed) {
651
7.30k
        return Status::OK();
652
7.30k
    }
653
7.08k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
7.08k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
7.08k
    }
656
7.08k
    _closed = true;
657
7.08k
    return Status::OK();
658
14.3k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
87.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
87.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
87.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
87.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
87.0k
    }
656
87.0k
    _closed = true;
657
87.0k
    return Status::OK();
658
87.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
104k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
104k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
104k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
104k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
104k
    }
656
104k
    _closed = true;
657
104k
    return Status::OK();
658
104k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
175
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
175
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
175
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
175
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
175
    }
656
175
    _closed = true;
657
175
    return Status::OK();
658
175
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
918k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
918k
    if (_closed) {
651
16.1k
        return Status::OK();
652
16.1k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
902k
    _closed = true;
657
902k
    return Status::OK();
658
918k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.5k
    }
656
54.5k
    _closed = true;
657
54.5k
    return Status::OK();
658
54.5k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.07k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.07k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.07k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.07k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.07k
    }
656
5.07k
    _closed = true;
657
5.07k
    return Status::OK();
658
5.07k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
868
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
868
    if (_closed) {
651
436
        return Status::OK();
652
436
    }
653
432
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
432
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
432
    }
656
432
    _closed = true;
657
432
    return Status::OK();
658
868
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.9k
    if (_closed) {
651
5.70k
        return Status::OK();
652
5.70k
    }
653
5.28k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.28k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.28k
    }
656
5.28k
    _closed = true;
657
5.28k
    return Status::OK();
658
10.9k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
676k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
676k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
676k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
676k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
676k
    }
656
676k
    _closed = true;
657
676k
    return Status::OK();
658
676k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
335
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
335
    if (_closed) {
651
175
        return Status::OK();
652
175
    }
653
160
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
160
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
160
    }
656
160
    _closed = true;
657
160
    return Status::OK();
658
335
}
659
660
template <typename SharedState>
661
1.76M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.76M
    _operator_profile =
664
1.76M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.76M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.76M
    _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.76M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.76M
    _operator_profile->add_child(_common_profile, true);
673
1.76M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.76M
    _operator_profile->set_metadata(_parent->node_id());
676
1.76M
    _wait_for_finish_dependency_timer =
677
1.76M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.76M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.76M
    if constexpr (!is_fake_shared) {
680
1.26M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.26M
            info.shared_state_map.end()) {
682
360k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
243k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
243k
            }
685
360k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
360k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
360k
                                                  ? 0
688
360k
                                                  : info.task_idx]
689
360k
                                  .get();
690
360k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
903k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
903k
            _shared_state = info.shared_state->template cast<SharedState>();
696
903k
            _dependency = _shared_state->create_sink_dependency(
697
903k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
903k
        }
699
1.26M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.26M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.26M
    }
702
703
1.76M
    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.76M
    _rows_input_counter =
708
1.76M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.76M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.76M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.76M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.76M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.76M
    _memory_used_counter =
714
1.76M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.76M
    _common_profile->add_info_string("IsColocate",
716
1.76M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.76M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.76M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.76M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.76M
    return Status::OK();
721
1.76M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
118k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
118k
    _operator_profile =
664
118k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
118k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
118k
    _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
118k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
118k
    _operator_profile->add_child(_common_profile, true);
673
118k
    _operator_profile->add_child(_custom_profile, true);
674
675
118k
    _operator_profile->set_metadata(_parent->node_id());
676
118k
    _wait_for_finish_dependency_timer =
677
118k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
118k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
118k
    if constexpr (!is_fake_shared) {
680
118k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
118k
            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.2k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
12.2k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
12.2k
                                                  ? 0
688
12.2k
                                                  : info.task_idx]
689
12.2k
                                  .get();
690
12.2k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
105k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
105k
            _shared_state = info.shared_state->template cast<SharedState>();
696
105k
            _dependency = _shared_state->create_sink_dependency(
697
105k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
105k
        }
699
118k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
118k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
118k
    }
702
703
118k
    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
118k
    _rows_input_counter =
708
118k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
118k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
118k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
118k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
118k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
118k
    _memory_used_counter =
714
118k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
118k
    _common_profile->add_info_string("IsColocate",
716
118k
                                     std::to_string(_parent->is_colocated_operator()));
717
118k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
118k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
118k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
118k
    return Status::OK();
721
118k
}
_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
201k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
201k
    _operator_profile =
664
201k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
201k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
201k
    _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
201k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
201k
    _operator_profile->add_child(_common_profile, true);
673
201k
    _operator_profile->add_child(_custom_profile, true);
674
675
201k
    _operator_profile->set_metadata(_parent->node_id());
676
201k
    _wait_for_finish_dependency_timer =
677
201k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
201k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
201k
    if constexpr (!is_fake_shared) {
680
201k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
201k
            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
201k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
201k
            _shared_state = info.shared_state->template cast<SharedState>();
696
201k
            _dependency = _shared_state->create_sink_dependency(
697
201k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
201k
        }
699
201k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
201k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
201k
    }
702
703
201k
    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
201k
    _rows_input_counter =
708
201k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
201k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
201k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
201k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
201k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
201k
    _memory_used_counter =
714
201k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
201k
    _common_profile->add_info_string("IsColocate",
716
201k
                                     std::to_string(_parent->is_colocated_operator()));
717
201k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
201k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
201k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
201k
    return Status::OK();
721
201k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
32
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
32
    _operator_profile =
664
32
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
32
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
32
    _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
32
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
32
    _operator_profile->add_child(_common_profile, true);
673
32
    _operator_profile->add_child(_custom_profile, true);
674
675
32
    _operator_profile->set_metadata(_parent->node_id());
676
32
    _wait_for_finish_dependency_timer =
677
32
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
32
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
32
    if constexpr (!is_fake_shared) {
680
32
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
32
            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
32
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
32
            _shared_state = info.shared_state->template cast<SharedState>();
696
32
            _dependency = _shared_state->create_sink_dependency(
697
32
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
32
        }
699
32
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
32
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
32
    }
702
703
32
    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
32
    _rows_input_counter =
708
32
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
32
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
32
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
32
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
32
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
32
    _memory_used_counter =
714
32
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
32
    _common_profile->add_info_string("IsColocate",
716
32
                                     std::to_string(_parent->is_colocated_operator()));
717
32
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
32
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
32
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
32
    return Status::OK();
721
32
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.19k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.19k
    _operator_profile =
664
7.19k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.19k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.19k
    _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
7.19k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.19k
    _operator_profile->add_child(_common_profile, true);
673
7.19k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.19k
    _operator_profile->set_metadata(_parent->node_id());
676
7.19k
    _wait_for_finish_dependency_timer =
677
7.19k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.19k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.19k
    if constexpr (!is_fake_shared) {
680
7.19k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.19k
            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
7.19k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.19k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.19k
            _dependency = _shared_state->create_sink_dependency(
697
7.19k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.19k
        }
699
7.19k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.19k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.19k
    }
702
703
7.19k
    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
7.19k
    _rows_input_counter =
708
7.19k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.19k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.19k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.19k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.19k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.19k
    _memory_used_counter =
714
7.19k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.19k
    _common_profile->add_info_string("IsColocate",
716
7.19k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.19k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.19k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.19k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.19k
    return Status::OK();
721
7.19k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.07k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.07k
    _operator_profile =
664
7.07k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.07k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.07k
    _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
7.07k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.07k
    _operator_profile->add_child(_common_profile, true);
673
7.07k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.07k
    _operator_profile->set_metadata(_parent->node_id());
676
7.07k
    _wait_for_finish_dependency_timer =
677
7.07k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.07k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.07k
    if constexpr (!is_fake_shared) {
680
7.07k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.07k
            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
7.07k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.07k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.07k
            _dependency = _shared_state->create_sink_dependency(
697
7.07k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.07k
        }
699
7.07k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.07k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.07k
    }
702
703
7.07k
    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
7.07k
    _rows_input_counter =
708
7.07k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.07k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.07k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.07k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.07k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.07k
    _memory_used_counter =
714
7.07k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.07k
    _common_profile->add_info_string("IsColocate",
716
7.07k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.07k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.07k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.07k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.07k
    return Status::OK();
721
7.07k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
87.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
87.1k
    _operator_profile =
664
87.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
87.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
87.1k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
87.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
87.1k
    _operator_profile->add_child(_common_profile, true);
673
87.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
87.1k
    _operator_profile->set_metadata(_parent->node_id());
676
87.1k
    _wait_for_finish_dependency_timer =
677
87.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
87.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
87.1k
    if constexpr (!is_fake_shared) {
680
87.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
87.1k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
87.1k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
87.1k
            _shared_state = info.shared_state->template cast<SharedState>();
696
87.1k
            _dependency = _shared_state->create_sink_dependency(
697
87.1k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
87.1k
        }
699
87.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
87.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
87.1k
    }
702
703
87.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
87.1k
    _rows_input_counter =
708
87.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
87.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
87.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
87.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
87.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
87.1k
    _memory_used_counter =
714
87.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
87.1k
    _common_profile->add_info_string("IsColocate",
716
87.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
87.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
87.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
87.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
87.1k
    return Status::OK();
721
87.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
104k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
104k
    _operator_profile =
664
104k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
104k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
104k
    _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
104k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
104k
    _operator_profile->add_child(_common_profile, true);
673
104k
    _operator_profile->add_child(_custom_profile, true);
674
675
104k
    _operator_profile->set_metadata(_parent->node_id());
676
104k
    _wait_for_finish_dependency_timer =
677
104k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
104k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
104k
    if constexpr (!is_fake_shared) {
680
104k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
105k
            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
105k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
105k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
105k
                                                  ? 0
688
105k
                                                  : info.task_idx]
689
105k
                                  .get();
690
105k
            _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
104k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
104k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
104k
    }
702
703
104k
    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
104k
    _rows_input_counter =
708
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
104k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
104k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
104k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
104k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
104k
    _memory_used_counter =
714
104k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
104k
    _common_profile->add_info_string("IsColocate",
716
104k
                                     std::to_string(_parent->is_colocated_operator()));
717
104k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
104k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
104k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
104k
    return Status::OK();
721
104k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
186
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
186
    _operator_profile =
664
186
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
186
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
186
    _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
186
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
186
    _operator_profile->add_child(_common_profile, true);
673
186
    _operator_profile->add_child(_custom_profile, true);
674
675
186
    _operator_profile->set_metadata(_parent->node_id());
676
186
    _wait_for_finish_dependency_timer =
677
186
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
186
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
186
    if constexpr (!is_fake_shared) {
680
186
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
186
            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
186
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
186
            _shared_state = info.shared_state->template cast<SharedState>();
696
186
            _dependency = _shared_state->create_sink_dependency(
697
186
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
186
        }
699
186
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
186
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
186
    }
702
703
186
    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
186
    _rows_input_counter =
708
186
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
186
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
186
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
186
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
186
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
186
    _memory_used_counter =
714
186
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
186
    _common_profile->add_info_string("IsColocate",
716
186
                                     std::to_string(_parent->is_colocated_operator()));
717
186
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
186
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
186
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
186
    return Status::OK();
721
186
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
501k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
501k
    _operator_profile =
664
501k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
501k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
501k
    _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
501k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
501k
    _operator_profile->add_child(_common_profile, true);
673
501k
    _operator_profile->add_child(_custom_profile, true);
674
675
501k
    _operator_profile->set_metadata(_parent->node_id());
676
501k
    _wait_for_finish_dependency_timer =
677
501k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
501k
    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
501k
    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
501k
    _rows_input_counter =
708
501k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
501k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
501k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
501k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
501k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
501k
    _memory_used_counter =
714
501k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
501k
    _common_profile->add_info_string("IsColocate",
716
501k
                                     std::to_string(_parent->is_colocated_operator()));
717
501k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
501k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
501k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
501k
    return Status::OK();
721
501k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
10.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
10.1k
    _operator_profile =
664
10.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
10.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
10.1k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
10.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
10.1k
    _operator_profile->add_child(_common_profile, true);
673
10.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
10.1k
    _operator_profile->set_metadata(_parent->node_id());
676
10.1k
    _wait_for_finish_dependency_timer =
677
10.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
10.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
10.1k
    if constexpr (!is_fake_shared) {
680
10.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
10.1k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
10.1k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
10.1k
            _shared_state = info.shared_state->template cast<SharedState>();
696
10.1k
            _dependency = _shared_state->create_sink_dependency(
697
10.1k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
10.1k
        }
699
10.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
10.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
10.1k
    }
702
703
10.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
10.1k
    _rows_input_counter =
708
10.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
10.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
10.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
10.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
10.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
10.1k
    _memory_used_counter =
714
10.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
10.1k
    _common_profile->add_info_string("IsColocate",
716
10.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
10.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
10.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
10.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
10.1k
    return Status::OK();
721
10.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
538
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
538
    _operator_profile =
664
538
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
538
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
538
    _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
538
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
538
    _operator_profile->add_child(_common_profile, true);
673
538
    _operator_profile->add_child(_custom_profile, true);
674
675
538
    _operator_profile->set_metadata(_parent->node_id());
676
538
    _wait_for_finish_dependency_timer =
677
538
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
538
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
538
    if constexpr (!is_fake_shared) {
680
538
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
538
            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
538
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
538
            _shared_state = info.shared_state->template cast<SharedState>();
696
538
            _dependency = _shared_state->create_sink_dependency(
697
538
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
538
        }
699
538
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
538
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
538
    }
702
703
538
    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
538
    _rows_input_counter =
708
538
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
538
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
538
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
538
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
538
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
538
    _memory_used_counter =
714
538
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
538
    _common_profile->add_info_string("IsColocate",
716
538
                                     std::to_string(_parent->is_colocated_operator()));
717
538
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
538
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
538
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
538
    return Status::OK();
721
538
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
1.99k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.99k
    _operator_profile =
664
1.99k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.99k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.99k
    _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.99k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.99k
    _operator_profile->add_child(_common_profile, true);
673
1.99k
    _operator_profile->add_child(_custom_profile, true);
674
675
1.99k
    _operator_profile->set_metadata(_parent->node_id());
676
1.99k
    _wait_for_finish_dependency_timer =
677
1.99k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.99k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.99k
    if constexpr (!is_fake_shared) {
680
1.99k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.99k
            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.99k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
1.99k
            _shared_state = info.shared_state->template cast<SharedState>();
696
1.99k
            _dependency = _shared_state->create_sink_dependency(
697
1.99k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
1.99k
        }
699
1.99k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.99k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.99k
    }
702
703
1.99k
    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.99k
    _rows_input_counter =
708
1.99k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.99k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.99k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.99k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.99k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.99k
    _memory_used_counter =
714
1.99k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.99k
    _common_profile->add_info_string("IsColocate",
716
1.99k
                                     std::to_string(_parent->is_colocated_operator()));
717
1.99k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.99k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.99k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.99k
    return Status::OK();
721
1.99k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
13.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
13.0k
    _operator_profile =
664
13.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
13.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
13.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
13.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
13.0k
    _operator_profile->add_child(_common_profile, true);
673
13.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
13.0k
    _operator_profile->set_metadata(_parent->node_id());
676
13.0k
    _wait_for_finish_dependency_timer =
677
13.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
13.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
13.0k
    if constexpr (!is_fake_shared) {
680
13.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
13.0k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
13.0k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
13.0k
            _shared_state = info.shared_state->template cast<SharedState>();
696
13.0k
            _dependency = _shared_state->create_sink_dependency(
697
13.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
13.0k
        }
699
13.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
13.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
13.0k
    }
702
703
13.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
13.0k
    _rows_input_counter =
708
13.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
13.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
13.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
13.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
13.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
13.0k
    _memory_used_counter =
714
13.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
13.0k
    _common_profile->add_info_string("IsColocate",
716
13.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
13.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
13.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
13.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
13.0k
    return Status::OK();
721
13.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
243k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
243k
    _operator_profile =
664
243k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
243k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
243k
    _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
243k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
243k
    _operator_profile->add_child(_common_profile, true);
673
243k
    _operator_profile->add_child(_custom_profile, true);
674
675
243k
    _operator_profile->set_metadata(_parent->node_id());
676
243k
    _wait_for_finish_dependency_timer =
677
243k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
243k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
243k
    if constexpr (!is_fake_shared) {
680
243k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
243k
            info.shared_state_map.end()) {
682
243k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
243k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
243k
            }
685
243k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
243k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
243k
                                                  ? 0
688
243k
                                                  : info.task_idx]
689
243k
                                  .get();
690
243k
            _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
243k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
243k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
243k
    }
702
703
243k
    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
243k
    _rows_input_counter =
708
243k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
243k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
243k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
243k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
243k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
243k
    _memory_used_counter =
714
243k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
243k
    _common_profile->add_info_string("IsColocate",
716
243k
                                     std::to_string(_parent->is_colocated_operator()));
717
243k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
243k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
243k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
243k
    return Status::OK();
721
243k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
468k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
468k
    _operator_profile =
664
468k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
468k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
468k
    _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
468k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
468k
    _operator_profile->add_child(_common_profile, true);
673
468k
    _operator_profile->add_child(_custom_profile, true);
674
675
468k
    _operator_profile->set_metadata(_parent->node_id());
676
468k
    _wait_for_finish_dependency_timer =
677
468k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
468k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
468k
    if constexpr (!is_fake_shared) {
680
468k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
468k
            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
468k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
468k
            _shared_state = info.shared_state->template cast<SharedState>();
696
468k
            _dependency = _shared_state->create_sink_dependency(
697
468k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
468k
        }
699
468k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
468k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
468k
    }
702
703
468k
    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
468k
    _rows_input_counter =
708
468k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
468k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
468k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
468k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
468k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
468k
    _memory_used_counter =
714
468k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
468k
    _common_profile->add_info_string("IsColocate",
716
468k
                                     std::to_string(_parent->is_colocated_operator()));
717
468k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
468k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
468k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
468k
    return Status::OK();
721
468k
}
_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
336
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
336
    _operator_profile =
664
336
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
336
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
336
    _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
336
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
336
    _operator_profile->add_child(_common_profile, true);
673
336
    _operator_profile->add_child(_custom_profile, true);
674
675
336
    _operator_profile->set_metadata(_parent->node_id());
676
336
    _wait_for_finish_dependency_timer =
677
336
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
336
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
336
    if constexpr (!is_fake_shared) {
680
336
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
336
            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
336
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
336
            _shared_state = info.shared_state->template cast<SharedState>();
696
336
            _dependency = _shared_state->create_sink_dependency(
697
336
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
336
        }
699
336
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
336
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
336
    }
702
703
336
    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
336
    _rows_input_counter =
708
336
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
336
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
336
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
336
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
336
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
336
    _memory_used_counter =
714
336
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
336
    _common_profile->add_info_string("IsColocate",
716
336
                                     std::to_string(_parent->is_colocated_operator()));
717
336
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
336
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
336
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
336
    return Status::OK();
721
336
}
722
723
template <typename SharedState>
724
1.76M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.76M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.76M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.26M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.26M
    }
731
1.76M
    _closed = true;
732
1.76M
    return Status::OK();
733
1.76M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
118k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
118k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
118k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
118k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
118k
    }
731
118k
    _closed = true;
732
118k
    return Status::OK();
733
118k
}
_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
201k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
201k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
201k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
201k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
201k
    }
731
201k
    _closed = true;
732
201k
    return Status::OK();
733
201k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
23
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
23
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
21
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
21
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
21
    }
731
21
    _closed = true;
732
21
    return Status::OK();
733
23
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.15k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.15k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.15k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.15k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.15k
    }
731
7.15k
    _closed = true;
732
7.15k
    return Status::OK();
733
7.15k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.07k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.07k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.07k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.07k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.07k
    }
731
7.07k
    _closed = true;
732
7.07k
    return Status::OK();
733
7.07k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
86.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
86.8k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
86.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
86.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
86.8k
    }
731
86.8k
    _closed = true;
732
86.8k
    return Status::OK();
733
86.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
104k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
104k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
104k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
104k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
104k
    }
731
104k
    _closed = true;
732
104k
    return Status::OK();
733
104k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
175
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
175
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
175
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
175
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
175
    }
731
175
    _closed = true;
732
175
    return Status::OK();
733
175
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
503k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
503k
    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
503k
    _closed = true;
732
503k
    return Status::OK();
733
503k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
10.1k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
10.1k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
10.1k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
10.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
10.1k
    }
731
10.1k
    _closed = true;
732
10.1k
    return Status::OK();
733
10.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
436
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
436
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
436
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
436
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
436
    }
731
436
    _closed = true;
732
436
    return Status::OK();
733
436
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.00k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.00k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.00k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.00k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.00k
    }
731
2.00k
    _closed = true;
732
2.00k
    return Status::OK();
733
2.00k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
13.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
13.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
13.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
13.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
13.0k
    }
731
13.0k
    _closed = true;
732
13.0k
    return Status::OK();
733
13.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
244k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
244k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
244k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
244k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
244k
    }
731
244k
    _closed = true;
732
244k
    return Status::OK();
733
244k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
470k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
470k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
470k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
470k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
470k
    }
731
470k
    _closed = true;
732
470k
    return Status::OK();
733
470k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
14
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
14
    }
731
14
    _closed = true;
732
14
    return Status::OK();
733
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
338
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
338
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
338
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
338
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
338
    }
731
338
    _closed = true;
732
338
    return Status::OK();
733
338
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
7.81k
                                                          bool* eos) {
738
7.81k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.80k
    return pull(state, block, eos);
740
7.81k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
37
                                                          bool* eos) {
738
37
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
37
    return pull(state, block, eos);
740
37
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
7.77k
                                                          bool* eos) {
738
7.77k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.76k
    return pull(state, block, eos);
740
7.77k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
587k
                                                         bool* eos) {
745
587k
    auto& local_state = get_local_state(state);
746
587k
    if (need_more_input_data(state)) {
747
555k
        local_state._child_block->clear_column_data(
748
555k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
555k
                        .num_materialized_slots());
750
555k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
555k
                state, local_state._child_block.get(), &local_state._child_eos));
752
555k
        *eos = local_state._child_eos;
753
555k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
89.2k
            return Status::OK();
755
89.2k
        }
756
466k
        {
757
466k
            SCOPED_TIMER(local_state.exec_time_counter());
758
466k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
466k
        }
760
466k
    }
761
762
497k
    if (!need_more_input_data(state)) {
763
474k
        SCOPED_TIMER(local_state.exec_time_counter());
764
474k
        bool new_eos = false;
765
474k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
474k
        if (new_eos) {
767
393k
            *eos = true;
768
393k
        } else if (!need_more_input_data(state)) {
769
25.5k
            *eos = false;
770
25.5k
        }
771
474k
    }
772
497k
    return Status::OK();
773
497k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
149k
                                                         bool* eos) {
745
149k
    auto& local_state = get_local_state(state);
746
149k
    if (need_more_input_data(state)) {
747
131k
        local_state._child_block->clear_column_data(
748
131k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
131k
                        .num_materialized_slots());
750
131k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
131k
                state, local_state._child_block.get(), &local_state._child_eos));
752
131k
        *eos = local_state._child_eos;
753
131k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
44.3k
            return Status::OK();
755
44.3k
        }
756
86.9k
        {
757
86.9k
            SCOPED_TIMER(local_state.exec_time_counter());
758
86.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
86.9k
        }
760
86.9k
    }
761
762
105k
    if (!need_more_input_data(state)) {
763
105k
        SCOPED_TIMER(local_state.exec_time_counter());
764
105k
        bool new_eos = false;
765
105k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
105k
        if (new_eos) {
767
45.9k
            *eos = true;
768
59.2k
        } else if (!need_more_input_data(state)) {
769
11.1k
            *eos = false;
770
11.1k
        }
771
105k
    }
772
105k
    return Status::OK();
773
105k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.65k
                                                         bool* eos) {
745
4.65k
    auto& local_state = get_local_state(state);
746
4.65k
    if (need_more_input_data(state)) {
747
2.65k
        local_state._child_block->clear_column_data(
748
2.65k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.65k
                        .num_materialized_slots());
750
2.65k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.65k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.65k
        *eos = local_state._child_eos;
753
2.65k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
768
            return Status::OK();
755
768
        }
756
1.89k
        {
757
1.89k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.89k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.89k
        }
760
1.89k
    }
761
762
3.90k
    if (!need_more_input_data(state)) {
763
3.90k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.90k
        bool new_eos = false;
765
3.90k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.90k
        if (new_eos) {
767
1.23k
            *eos = true;
768
2.66k
        } else if (!need_more_input_data(state)) {
769
2.00k
            *eos = false;
770
2.00k
        }
771
3.90k
    }
772
3.89k
    return Status::OK();
773
3.89k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.97k
                                                         bool* eos) {
745
1.97k
    auto& local_state = get_local_state(state);
746
1.97k
    if (need_more_input_data(state)) {
747
1.97k
        local_state._child_block->clear_column_data(
748
1.97k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.97k
                        .num_materialized_slots());
750
1.97k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.97k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.97k
        *eos = local_state._child_eos;
753
1.97k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
764
            return Status::OK();
755
764
        }
756
1.21k
        {
757
1.21k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.21k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.21k
        }
760
1.21k
    }
761
762
1.21k
    if (!need_more_input_data(state)) {
763
1.21k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.21k
        bool new_eos = false;
765
1.21k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.21k
        if (new_eos) {
767
787
            *eos = true;
768
787
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.21k
    }
772
1.21k
    return Status::OK();
773
1.21k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
18.2k
                                                         bool* eos) {
745
18.2k
    auto& local_state = get_local_state(state);
746
18.2k
    if (need_more_input_data(state)) {
747
18.2k
        local_state._child_block->clear_column_data(
748
18.2k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
18.2k
                        .num_materialized_slots());
750
18.2k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
18.2k
                state, local_state._child_block.get(), &local_state._child_eos));
752
18.2k
        *eos = local_state._child_eos;
753
18.2k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
5.38k
            return Status::OK();
755
5.38k
        }
756
12.8k
        {
757
12.8k
            SCOPED_TIMER(local_state.exec_time_counter());
758
12.8k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
12.8k
        }
760
12.8k
    }
761
762
12.8k
    if (!need_more_input_data(state)) {
763
7.05k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.05k
        bool new_eos = false;
765
7.05k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.05k
        if (new_eos) {
767
6.93k
            *eos = true;
768
6.93k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
7.05k
    }
772
12.8k
    return Status::OK();
773
12.8k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
380k
                                                         bool* eos) {
745
380k
    auto& local_state = get_local_state(state);
746
381k
    if (need_more_input_data(state)) {
747
381k
        local_state._child_block->clear_column_data(
748
381k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
381k
                        .num_materialized_slots());
750
381k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
381k
                state, local_state._child_block.get(), &local_state._child_eos));
752
381k
        *eos = local_state._child_eos;
753
381k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
36.2k
            return Status::OK();
755
36.2k
        }
756
344k
        {
757
344k
            SCOPED_TIMER(local_state.exec_time_counter());
758
344k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
344k
        }
760
344k
    }
761
762
344k
    if (!need_more_input_data(state)) {
763
327k
        SCOPED_TIMER(local_state.exec_time_counter());
764
327k
        bool new_eos = false;
765
327k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
327k
        if (new_eos) {
767
326k
            *eos = true;
768
326k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
327k
    }
772
344k
    return Status::OK();
773
344k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
24.3k
                                                         bool* eos) {
745
24.3k
    auto& local_state = get_local_state(state);
746
24.3k
    if (need_more_input_data(state)) {
747
12.2k
        local_state._child_block->clear_column_data(
748
12.2k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
12.2k
                        .num_materialized_slots());
750
12.2k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
12.2k
                state, local_state._child_block.get(), &local_state._child_eos));
752
12.2k
        *eos = local_state._child_eos;
753
12.2k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
659
            return Status::OK();
755
659
        }
756
11.6k
        {
757
11.6k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.6k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.6k
        }
760
11.6k
    }
761
762
23.6k
    if (!need_more_input_data(state)) {
763
22.9k
        SCOPED_TIMER(local_state.exec_time_counter());
764
22.9k
        bool new_eos = false;
765
22.9k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
22.9k
        if (new_eos) {
767
7.14k
            *eos = true;
768
15.8k
        } else if (!need_more_input_data(state)) {
769
12.0k
            *eos = false;
770
12.0k
        }
771
22.9k
    }
772
23.6k
    return Status::OK();
773
23.6k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
8.07k
                                                         bool* eos) {
745
8.07k
    auto& local_state = get_local_state(state);
746
8.07k
    if (need_more_input_data(state)) {
747
7.72k
        local_state._child_block->clear_column_data(
748
7.72k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
7.72k
                        .num_materialized_slots());
750
7.72k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
7.72k
                state, local_state._child_block.get(), &local_state._child_eos));
752
7.72k
        *eos = local_state._child_eos;
753
7.72k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.03k
            return Status::OK();
755
1.03k
        }
756
6.68k
        {
757
6.68k
            SCOPED_TIMER(local_state.exec_time_counter());
758
6.68k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
6.68k
        }
760
6.68k
    }
761
762
7.04k
    if (!need_more_input_data(state)) {
763
7.04k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.04k
        bool new_eos = false;
765
7.04k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.04k
        if (new_eos) {
767
4.89k
            *eos = true;
768
4.89k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
7.04k
    }
772
7.03k
    return Status::OK();
773
7.03k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
47.1k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.1k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.1k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.1k
                                                         "AsyncWriterDependency", true);
781
47.1k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.1k
                             _finish_dependency));
783
784
47.1k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.1k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.1k
    return Status::OK();
787
47.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
378
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
378
    RETURN_IF_ERROR(Base::init(state, info));
779
378
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
378
                                                         "AsyncWriterDependency", true);
781
378
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
378
                             _finish_dependency));
783
784
378
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
378
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
378
    return Status::OK();
787
378
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
46.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.7k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.7k
                                                         "AsyncWriterDependency", true);
781
46.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.7k
                             _finish_dependency));
783
784
46.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.7k
    return Status::OK();
787
46.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
40
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
40
    RETURN_IF_ERROR(Base::init(state, info));
779
40
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
40
                                                         "AsyncWriterDependency", true);
781
40
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
40
                             _finish_dependency));
783
784
40
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
40
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
40
    return Status::OK();
787
40
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
47.8k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.8k
    RETURN_IF_ERROR(Base::open(state));
793
47.8k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
370k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
322k
        RETURN_IF_ERROR(
796
322k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
322k
    }
798
47.8k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.8k
    return Status::OK();
800
47.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
380
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
380
    RETURN_IF_ERROR(Base::open(state));
793
380
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.92k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.54k
        RETURN_IF_ERROR(
796
1.54k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.54k
    }
798
380
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
380
    return Status::OK();
800
380
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
47.4k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.4k
    RETURN_IF_ERROR(Base::open(state));
793
47.4k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
367k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
320k
        RETURN_IF_ERROR(
796
320k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
320k
    }
798
47.4k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.4k
    return Status::OK();
800
47.4k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
40
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
40
    RETURN_IF_ERROR(Base::open(state));
793
40
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
720
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
680
        RETURN_IF_ERROR(
796
680
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
680
    }
798
40
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
40
    return Status::OK();
800
40
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
63.1k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
63.1k
    return _writer->sink(block, eos);
806
63.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.71k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.71k
    return _writer->sink(block, eos);
806
1.71k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
61.3k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.3k
    return _writer->sink(block, eos);
806
61.3k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
40
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
40
    return _writer->sink(block, eos);
806
40
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
47.9k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.9k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.9k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.9k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
47.9k
    if (_writer) {
818
47.9k
        Status st = _writer->get_writer_status();
819
47.9k
        if (exec_status.ok()) {
820
47.8k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.8k
                                                       : Status::Cancelled("force close"));
822
47.8k
        } else {
823
91
            _writer->force_close(exec_status);
824
91
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
47.9k
        RETURN_IF_ERROR(st);
829
47.9k
    }
830
47.8k
    return Base::close(state, exec_status);
831
47.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
368
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
368
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
368
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
368
    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
368
    if (_writer) {
818
368
        Status st = _writer->get_writer_status();
819
368
        if (exec_status.ok()) {
820
368
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
368
                                                       : Status::Cancelled("force close"));
822
368
        } 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
368
        RETURN_IF_ERROR(st);
829
368
    }
830
368
    return Base::close(state, exec_status);
831
368
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
47.5k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.5k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.5k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.5k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
47.5k
    if (_writer) {
818
47.5k
        Status st = _writer->get_writer_status();
819
47.5k
        if (exec_status.ok()) {
820
47.4k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.4k
                                                       : Status::Cancelled("force close"));
822
47.4k
        } else {
823
91
            _writer->force_close(exec_status);
824
91
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
47.5k
        RETURN_IF_ERROR(st);
829
47.5k
    }
830
47.4k
    return Base::close(state, exec_status);
831
47.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
40
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
40
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
40
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
40
    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
40
    if (_writer) {
818
40
        Status st = _writer->get_writer_status();
819
40
        if (exec_status.ok()) {
820
40
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
40
                                                       : Status::Cancelled("force close"));
822
40
        } 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
40
        RETURN_IF_ERROR(st);
829
40
    }
830
40
    return Base::close(state, exec_status);
831
40
}
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