Coverage Report

Created: 2026-08-24 11:39

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.29M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.29M
    if (_parent->nereids_id() == -1) {
122
651k
        return fmt::format("(id={})", _parent->node_id());
123
651k
    } else {
124
648k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
648k
    }
126
1.29M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
59.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
59.9k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
59.9k
    } else {
124
59.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
59.9k
    }
126
59.9k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1
    if (_parent->nereids_id() == -1) {
122
1
        return fmt::format("(id={})", _parent->node_id());
123
1
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
155k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
155k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
155k
    } else {
124
155k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
155k
    }
126
155k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
35
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
35
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
35
    } else {
124
35
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
35
    }
126
35
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.82k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.82k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.82k
    } else {
124
5.82k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.82k
    }
126
5.82k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.88k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.88k
    if (_parent->nereids_id() == -1) {
122
11
        return fmt::format("(id={})", _parent->node_id());
123
6.87k
    } else {
124
6.87k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.87k
    }
126
6.88k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
79.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
79.8k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
79.8k
    } else {
124
79.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
79.8k
    }
126
79.8k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
69.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
69.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
69.1k
    } else {
124
69.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
69.1k
    }
126
69.1k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_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
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
423k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
423k
    if (_parent->nereids_id() == -1) {
122
208k
        return fmt::format("(id={})", _parent->node_id());
123
215k
    } else {
124
215k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
215k
    }
126
423k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
50.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
50.4k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
50.4k
    } else {
124
50.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
50.4k
    }
126
50.4k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.42k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.42k
    if (_parent->nereids_id() == -1) {
122
4.42k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
4.42k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
486
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
486
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
384
    } else {
124
384
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
384
    }
126
486
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.11k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.11k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.09k
    } else {
124
5.09k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.09k
    }
126
5.11k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
437k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
438k
    if (_parent->nereids_id() == -1) {
122
438k
        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
437k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
164
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
164
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
164
    } else {
124
164
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
164
    }
126
164
}
127
128
template <typename SharedStateArg>
129
971k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
971k
    if (_parent->nereids_id() == -1) {
131
539k
        return fmt::format("(id={})", _parent->node_id());
132
539k
    } else {
133
432k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
432k
    }
135
971k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
108k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
108k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
108k
    } else {
133
108k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
108k
    }
135
108k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
2
    if (_parent->nereids_id() == -1) {
131
1
        return fmt::format("(id={})", _parent->node_id());
132
1
    } else {
133
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
1
    }
135
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
156k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
156k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
156k
    } else {
133
156k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
156k
    }
135
156k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
42
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
42
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
42
    } else {
133
42
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
42
    }
135
42
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.85k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.85k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.85k
    } else {
133
5.85k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.85k
    }
135
5.85k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
6.92k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6.92k
    if (_parent->nereids_id() == -1) {
131
11
        return fmt::format("(id={})", _parent->node_id());
132
6.91k
    } else {
133
6.91k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
6.91k
    }
135
6.92k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
80.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
80.3k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
80.3k
    } else {
133
80.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
80.3k
    }
135
80.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
68.9k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
68.9k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
68.9k
    } else {
133
68.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
68.9k
    }
135
68.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
178
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
178
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
178
    } else {
133
178
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
178
    }
135
178
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
18
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
18
    if (_parent->nereids_id() == -1) {
131
18
        return fmt::format("(id={})", _parent->node_id());
132
18
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
4.57k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
4.57k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
4.57k
    } else {
133
4.57k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
4.57k
    }
135
4.57k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
490
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
490
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
388
    } else {
133
388
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
388
    }
135
490
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.4k
    if (_parent->nereids_id() == -1) {
131
12.4k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
180k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
180k
    if (_parent->nereids_id() == -1) {
131
180k
        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
180k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
346k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
346k
    if (_parent->nereids_id() == -1) {
131
346k
        return fmt::format("(id={})", _parent->node_id());
132
346k
    } else {
133
246
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
246
    }
135
346k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        return fmt::format("(id={})", _parent->node_id());
132
25
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
328
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
328
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
328
    } else {
133
328
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
328
    }
135
328
}
136
137
template <typename SharedStateArg>
138
31.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
31.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
31.0k
    _terminated = true;
143
31.0k
    return Status::OK();
144
31.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2.88k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.88k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.88k
    _terminated = true;
143
2.88k
    return Status::OK();
144
2.88k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
4
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
4
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
4
    _terminated = true;
143
4
    return Status::OK();
144
4
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.65k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.65k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.65k
    _terminated = true;
143
1.65k
    return Status::OK();
144
1.65k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.30k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.30k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.30k
    _terminated = true;
143
1.30k
    return Status::OK();
144
1.30k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
619
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
619
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
619
    _terminated = true;
143
619
    return Status::OK();
144
619
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
35
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
35
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
35
    _terminated = true;
143
35
    return Status::OK();
144
35
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
275
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
275
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
275
    _terminated = true;
143
275
    return Status::OK();
144
275
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24
    _terminated = true;
143
24
    return Status::OK();
144
24
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
146
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
146
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
146
    _terminated = true;
143
146
    return Status::OK();
144
146
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
132
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
132
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
132
    _terminated = true;
143
132
    return Status::OK();
144
132
}
145
146
266k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
266k
    return _child && _child->is_serial_operator() && !is_source()
148
266k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
266k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
266k
}
151
152
21.9k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
21.9k
    if (!_child) {
154
20.6k
        return false;
155
20.6k
    }
156
1.26k
    if (_child->is_serial_operator()) {
157
151
        return true;
158
151
    }
159
1.11k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.11k
    return child_distribution.need_local_exchange() &&
161
1.11k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.26k
}
163
164
template <typename SharedStateArg>
165
19.3k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.3k
    fmt::memory_buffer debug_string_buffer;
167
19.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.3k
    return fmt::to_string(debug_string_buffer);
169
19.3k
}
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
19.3k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.3k
    fmt::memory_buffer debug_string_buffer;
167
19.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.3k
    return fmt::to_string(debug_string_buffer);
169
19.3k
}
_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
19.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.3k
    fmt::memory_buffer debug_string_buffer;
174
19.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.3k
    return fmt::to_string(debug_string_buffer);
176
19.3k
}
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
19.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.3k
    fmt::memory_buffer debug_string_buffer;
174
19.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.3k
    return fmt::to_string(debug_string_buffer);
176
19.3k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
19.3k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
19.3k
    fmt::memory_buffer debug_string_buffer;
180
19.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
19.3k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
19.3k
                   _is_serial_operator);
183
19.3k
    return fmt::to_string(debug_string_buffer);
184
19.3k
}
185
186
19.3k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
19.3k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
19.3k
}
189
190
569k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
569k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
569k
    _nereids_id = tnode.nereids_id;
193
569k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.20k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.20k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.20k
            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.20k
    }
206
569k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
569k
    _op_name = substr + "_OPERATOR";
208
209
569k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
569k
    } else if (tnode.__isset.conjuncts) {
212
251k
        for (const auto& conjunct : tnode.conjuncts) {
213
251k
            VExprContextSPtr context;
214
251k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
251k
            _conjuncts.emplace_back(context);
216
251k
        }
217
85.7k
    }
218
219
    // create the projections expr
220
569k
    if (tnode.__isset.projections) {
221
234k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
234k
    }
223
569k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.20k
        DCHECK(has_projection()) << "no final projections";
225
3.20k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
4.23k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
4.23k
            VExprContextSPtrs projections;
228
4.23k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
4.23k
            _projection->intermediate_projections.push_back(projections);
230
4.23k
        }
231
3.20k
    }
232
569k
    return Status::OK();
233
569k
}
234
235
596k
Status OperatorXBase::prepare(RuntimeState* state) {
236
596k
    for (auto& conjunct : _conjuncts) {
237
251k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
251k
    }
239
596k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
546k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
325k
            return a->execute_cost() < b->execute_cost();
242
325k
        });
243
546k
    };
244
245
596k
    if (has_projection()) {
246
234k
        auto& projection = *_projection;
247
238k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
4.23k
            const auto& input_row_desc =
249
4.23k
                    i == 0 ? operator_row_desc_before_projection()
250
4.23k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
4.23k
            RETURN_IF_ERROR(
252
4.23k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
4.23k
        }
254
234k
        const auto& final_projection_input_row_desc =
255
234k
                projection.intermediate_output_row_descriptors.empty()
256
234k
                        ? operator_row_desc_before_projection()
257
234k
                        : projection.intermediate_output_row_descriptors.back();
258
234k
        RETURN_IF_ERROR(
259
234k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
234k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
234k
                                                      projection.output_row_descriptor));
262
234k
    }
263
264
596k
    for (auto& conjunct : _conjuncts) {
265
251k
        RETURN_IF_ERROR(conjunct->open(state));
266
251k
    }
267
596k
    if (has_projection()) {
268
234k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
234k
        for (auto& projections : _projection->intermediate_projections) {
270
4.23k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
4.23k
        }
272
234k
    }
273
596k
    if (_child && !is_source()) {
274
80.2k
        RETURN_IF_ERROR(_child->prepare(state));
275
80.2k
    }
276
277
596k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
596k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
596k
    return Status::OK();
283
596k
}
284
285
7.90k
Status OperatorXBase::terminate(RuntimeState* state) {
286
7.90k
    if (_child && !is_source()) {
287
811
        RETURN_IF_ERROR(_child->terminate(state));
288
811
    }
289
7.90k
    auto result = state->get_local_state_result(operator_id());
290
7.90k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
7.90k
    return result.value()->terminate(state);
294
7.90k
}
295
296
3.60M
Status OperatorXBase::close(RuntimeState* state) {
297
3.60M
    if (_child && !is_source()) {
298
549k
        RETURN_IF_ERROR(_child->close(state));
299
549k
    }
300
3.60M
    auto result = state->get_local_state_result(operator_id());
301
3.60M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
3.60M
    return result.value()->close(state);
305
3.60M
}
306
307
255k
void PipelineXLocalStateBase::clear_origin_block() {
308
255k
    _origin_block.clear_column_data(
309
255k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
255k
}
311
312
578k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
578k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
578k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
578k
    return Status::OK();
317
578k
}
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
255k
                                     Block* output_block) const {
326
255k
    auto* local_state = state->get_local_state(operator_id());
327
255k
    SCOPED_TIMER(local_state->exec_time_counter());
328
255k
    SCOPED_TIMER(local_state->_projection_timer);
329
255k
    const size_t rows = origin_block->rows();
330
255k
    if (rows == 0) {
331
131k
        return Status::OK();
332
131k
    }
333
124k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
124k
    {
336
124k
        Block input_block = *origin_block;
337
338
124k
        ColumnsWithTypeAndName new_columns;
339
124k
        for (const auto& projections : local_state->_intermediate_projections) {
340
1.44k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
1.44k
            new_columns.resize(projections.size());
345
8.60k
            for (int i = 0; i < projections.size(); i++) {
346
7.16k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
7.16k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
7.16k
            }
355
1.44k
            Block tmp_block {new_columns};
356
1.44k
            input_block.swap(tmp_block);
357
1.44k
        }
358
359
124k
        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
124k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
124k
                output_block, _projection->output_row_descriptor);
368
124k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
124k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
124k
        Columns shared_columns(mutable_columns.size());
371
372
680k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
555k
            ColumnPtr column_ptr;
374
555k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
555k
            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
555k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
555k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
555k
            if (column_ptr->is_exclusive()) {
386
201k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
354k
            } else {
388
354k
                shared_columns[i] = std::move(column_ptr);
389
354k
            }
390
555k
        }
391
392
124k
        scoped_mutable_block.restore();
393
680k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
556k
            if (shared_columns[i]) {
395
354k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
354k
            }
397
556k
        }
398
124k
    }
399
400
0
    origin_block->clear_column_data(
401
124k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
124k
    DCHECK_EQ(output_block->rows(), rows);
403
404
124k
    return Status::OK();
405
124k
}
406
407
3.80M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
3.80M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
3.80M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
3.80M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
3.80M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
3.80M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
3.80M
            if (_debug_point_count++ % 2 == 0) {
414
3.80M
                return Status::OK();
415
3.80M
            }
416
3.80M
        }
417
3.80M
    });
418
419
3.80M
    Status status;
420
3.80M
    auto* local_state = state->get_local_state(operator_id());
421
3.80M
    Defer defer([&]() {
422
3.80M
        if (status.ok()) {
423
3.80M
            local_state->update_output_block_counters(*block);
424
3.80M
        }
425
3.80M
    });
426
3.80M
    if (has_projection()) {
427
255k
        local_state->clear_origin_block();
428
255k
        status = get_block(state, &local_state->_origin_block, eos);
429
255k
        if (UNLIKELY(!status.ok())) {
430
23
            return status;
431
23
        }
432
255k
        status = do_projections(state, &local_state->_origin_block, block);
433
255k
        return status;
434
255k
    }
435
3.54M
    status = get_block(state, block, eos);
436
3.54M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.54M
    return status;
438
3.54M
}
439
440
2.31M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.31M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
3.42k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
3.42k
        *eos = true;
444
3.42k
    }
445
446
2.31M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.31M
        auto op_name = to_lower(_parent->_op_name);
448
2.31M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.31M
        arg_op_name = to_lower(arg_op_name);
450
451
2.31M
        if (op_name == arg_op_name) {
452
2.31M
            *eos = true;
453
2.31M
        }
454
2.31M
    });
455
456
2.31M
    if (auto rows = block->rows()) {
457
688k
        _num_rows_returned += rows;
458
688k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
688k
    }
460
2.31M
}
461
462
31.0k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
31.0k
    auto result = state->get_sink_local_state_result();
464
31.0k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
31.0k
    return result.value()->terminate(state);
468
31.0k
}
469
470
19.3k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
19.3k
    fmt::memory_buffer debug_string_buffer;
472
473
19.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
19.3k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
19.3k
    return fmt::to_string(debug_string_buffer);
476
19.3k
}
477
478
19.3k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
19.3k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
19.3k
}
481
482
305k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
305k
    std::string op_name = "UNKNOWN_SINK";
484
305k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
305k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
305k
        op_name = it->second;
488
305k
    }
489
305k
    _name = op_name + "_OPERATOR";
490
305k
    return Status::OK();
491
305k
}
492
493
257k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
257k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
257k
    _nereids_id = tnode.nereids_id;
496
257k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
257k
    _name = substr + "_SINK_OPERATOR";
498
257k
    return Status::OK();
499
257k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.34M
                                                            LocalSinkStateInfo& info) {
504
1.34M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.34M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.34M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.34M
    return Status::OK();
508
1.34M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
108k
                                                            LocalSinkStateInfo& info) {
504
108k
    auto local_state = LocalStateType::create_unique(this, state);
505
108k
    RETURN_IF_ERROR(local_state->init(state, info));
506
108k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
108k
    return Status::OK();
508
108k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
305k
                                                            LocalSinkStateInfo& info) {
504
305k
    auto local_state = LocalStateType::create_unique(this, state);
505
305k
    RETURN_IF_ERROR(local_state->init(state, info));
506
305k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
305k
    return Status::OK();
508
305k
}
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
357
                                                            LocalSinkStateInfo& info) {
504
357
    auto local_state = LocalStateType::create_unique(this, state);
505
357
    RETURN_IF_ERROR(local_state->init(state, info));
506
357
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
357
    return Status::OK();
508
357
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
41.8k
                                                            LocalSinkStateInfo& info) {
504
41.8k
    auto local_state = LocalStateType::create_unique(this, state);
505
41.8k
    RETURN_IF_ERROR(local_state->init(state, info));
506
41.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
41.8k
    return Status::OK();
508
41.8k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_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
}
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
6.92k
                                                            LocalSinkStateInfo& info) {
504
6.92k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.92k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.92k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.92k
    return Status::OK();
508
6.92k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
15
                                                            LocalSinkStateInfo& info) {
504
15
    auto local_state = LocalStateType::create_unique(this, state);
505
15
    RETURN_IF_ERROR(local_state->init(state, info));
506
15
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
15
    return Status::OK();
508
15
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
157k
                                                            LocalSinkStateInfo& info) {
504
157k
    auto local_state = LocalStateType::create_unique(this, state);
505
157k
    RETURN_IF_ERROR(local_state->init(state, info));
506
157k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
157k
    return Status::OK();
508
157k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
42
                                                            LocalSinkStateInfo& info) {
504
42
    auto local_state = LocalStateType::create_unique(this, state);
505
42
    RETURN_IF_ERROR(local_state->init(state, info));
506
42
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
42
    return Status::OK();
508
42
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
180k
                                                            LocalSinkStateInfo& info) {
504
180k
    auto local_state = LocalStateType::create_unique(this, state);
505
180k
    RETURN_IF_ERROR(local_state->init(state, info));
506
180k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
180k
    return Status::OK();
508
180k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
80.4k
                                                            LocalSinkStateInfo& info) {
504
80.4k
    auto local_state = LocalStateType::create_unique(this, state);
505
80.4k
    RETURN_IF_ERROR(local_state->init(state, info));
506
80.4k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
80.4k
    return Status::OK();
508
80.4k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
69.0k
                                                            LocalSinkStateInfo& info) {
504
69.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
69.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
69.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
69.0k
    return Status::OK();
508
69.0k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
178
                                                            LocalSinkStateInfo& info) {
504
178
    auto local_state = LocalStateType::create_unique(this, state);
505
178
    RETURN_IF_ERROR(local_state->init(state, info));
506
178
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
178
    return Status::OK();
508
178
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
368k
                                                            LocalSinkStateInfo& info) {
504
368k
    auto local_state = LocalStateType::create_unique(this, state);
505
368k
    RETURN_IF_ERROR(local_state->init(state, info));
506
368k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
368k
    return Status::OK();
508
368k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.88k
                                                            LocalSinkStateInfo& info) {
504
5.88k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.88k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.88k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.88k
    return Status::OK();
508
5.88k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.57k
                                                            LocalSinkStateInfo& info) {
504
4.57k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.57k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.57k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.57k
    return Status::OK();
508
4.57k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1.83k
                                                            LocalSinkStateInfo& info) {
504
1.83k
    auto local_state = LocalStateType::create_unique(this, state);
505
1.83k
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.83k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.83k
    return Status::OK();
508
1.83k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
388
                                                            LocalSinkStateInfo& info) {
504
388
    auto local_state = LocalStateType::create_unique(this, state);
505
388
    RETURN_IF_ERROR(local_state->init(state, info));
506
388
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
388
    return Status::OK();
508
388
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.74k
                                                            LocalSinkStateInfo& info) {
504
4.74k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.74k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.74k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.74k
    return Status::OK();
508
4.74k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.53k
                                                            LocalSinkStateInfo& info) {
504
2.53k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.53k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.53k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.53k
    return Status::OK();
508
2.53k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.59k
                                                            LocalSinkStateInfo& info) {
504
2.59k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.59k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.59k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.59k
    return Status::OK();
508
2.59k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.47k
                                                            LocalSinkStateInfo& info) {
504
2.47k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.47k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.47k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.47k
    return Status::OK();
508
2.47k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
566
                                                            LocalSinkStateInfo& info) {
504
566
    auto local_state = LocalStateType::create_unique(this, state);
505
566
    RETURN_IF_ERROR(local_state->init(state, info));
506
566
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
566
    return Status::OK();
508
566
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
102
                                                            LocalSinkStateInfo& info) {
504
102
    auto local_state = LocalStateType::create_unique(this, state);
505
102
    RETURN_IF_ERROR(local_state->init(state, info));
506
102
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
102
    return Status::OK();
508
102
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
509
510
template <typename LocalStateType>
511
1.07M
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.07M
    } else {
519
1.07M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.07M
        ss->id = operator_id();
521
1.07M
        for (auto& dest : dests_id()) {
522
1.06M
            ss->related_op_ids.insert(dest);
523
1.06M
        }
524
1.07M
        return ss;
525
1.07M
    }
526
1.07M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
98.6k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
98.6k
    } else {
519
98.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
98.6k
        ss->id = operator_id();
521
98.6k
        for (auto& dest : dests_id()) {
522
98.5k
            ss->related_op_ids.insert(dest);
523
98.5k
        }
524
98.6k
        return ss;
525
98.6k
    }
526
98.6k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
305k
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
305k
    } else {
519
305k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
305k
        ss->id = operator_id();
521
305k
        for (auto& dest : dests_id()) {
522
303k
            ss->related_op_ids.insert(dest);
523
303k
        }
524
305k
        return ss;
525
305k
    }
526
305k
}
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
357
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
357
    } else {
519
357
        auto ss = LocalStateType::SharedStateType::create_shared();
520
357
        ss->id = operator_id();
521
357
        for (auto& dest : dests_id()) {
522
357
            ss->related_op_ids.insert(dest);
523
357
        }
524
357
        return ss;
525
357
    }
526
357
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
41.9k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
41.9k
    } else {
519
41.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
41.9k
        ss->id = operator_id();
521
41.9k
        for (auto& dest : dests_id()) {
522
41.6k
            ss->related_op_ids.insert(dest);
523
41.6k
        }
524
41.9k
        return ss;
525
41.9k
    }
526
41.9k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
32
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
32
    } else {
519
32
        auto ss = LocalStateType::SharedStateType::create_shared();
520
32
        ss->id = operator_id();
521
32
        for (auto& dest : dests_id()) {
522
32
            ss->related_op_ids.insert(dest);
523
32
        }
524
32
        return ss;
525
32
    }
526
32
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_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
6.94k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6.94k
    } else {
519
6.94k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.94k
        ss->id = operator_id();
521
6.95k
        for (auto& dest : dests_id()) {
522
6.95k
            ss->related_op_ids.insert(dest);
523
6.95k
        }
524
6.94k
        return ss;
525
6.94k
    }
526
6.94k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
15
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
15
    } else {
519
15
        auto ss = LocalStateType::SharedStateType::create_shared();
520
15
        ss->id = operator_id();
521
15
        for (auto& dest : dests_id()) {
522
15
            ss->related_op_ids.insert(dest);
523
15
        }
524
15
        return ss;
525
15
    }
526
15
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
157k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
157k
    } else {
519
157k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
157k
        ss->id = operator_id();
521
157k
        for (auto& dest : dests_id()) {
522
157k
            ss->related_op_ids.insert(dest);
523
157k
        }
524
157k
        return ss;
525
157k
    }
526
157k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
44
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
44
    } else {
519
44
        auto ss = LocalStateType::SharedStateType::create_shared();
520
44
        ss->id = operator_id();
521
44
        for (auto& dest : dests_id()) {
522
44
            ss->related_op_ids.insert(dest);
523
44
        }
524
44
        return ss;
525
44
    }
526
44
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
80.6k
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
80.6k
    } else {
519
80.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
80.6k
        ss->id = operator_id();
521
80.7k
        for (auto& dest : dests_id()) {
522
80.7k
            ss->related_op_ids.insert(dest);
523
80.7k
        }
524
80.6k
        return ss;
525
80.6k
    }
526
80.6k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
177
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
177
    } else {
519
177
        auto ss = LocalStateType::SharedStateType::create_shared();
520
177
        ss->id = operator_id();
521
177
        for (auto& dest : dests_id()) {
522
177
            ss->related_op_ids.insert(dest);
523
177
        }
524
177
        return ss;
525
177
    }
526
177
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
369k
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
369k
    } else {
519
369k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
369k
        ss->id = operator_id();
521
369k
        for (auto& dest : dests_id()) {
522
364k
            ss->related_op_ids.insert(dest);
523
364k
        }
524
369k
        return ss;
525
369k
    }
526
369k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
5.89k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
5.89k
    } else {
519
5.89k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
5.89k
        ss->id = operator_id();
521
5.90k
        for (auto& dest : dests_id()) {
522
5.90k
            ss->related_op_ids.insert(dest);
523
5.90k
        }
524
5.89k
        return ss;
525
5.89k
    }
526
5.89k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
491
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
491
    } else {
519
491
        auto ss = LocalStateType::SharedStateType::create_shared();
520
491
        ss->id = operator_id();
521
491
        for (auto& dest : dests_id()) {
522
489
            ss->related_op_ids.insert(dest);
523
489
        }
524
491
        return ss;
525
491
    }
526
491
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.57k
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.57k
    } else {
519
2.57k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.57k
        ss->id = operator_id();
521
2.57k
        for (auto& dest : dests_id()) {
522
2.56k
            ss->related_op_ids.insert(dest);
523
2.56k
        }
524
2.57k
        return ss;
525
2.57k
    }
526
2.57k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.47k
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.47k
    } else {
519
2.47k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.47k
        ss->id = operator_id();
521
2.48k
        for (auto& dest : dests_id()) {
522
2.48k
            ss->related_op_ids.insert(dest);
523
2.48k
        }
524
2.47k
        return ss;
525
2.47k
    }
526
2.47k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
567
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
567
    } else {
519
567
        auto ss = LocalStateType::SharedStateType::create_shared();
520
567
        ss->id = operator_id();
521
567
        for (auto& dest : dests_id()) {
522
561
            ss->related_op_ids.insert(dest);
523
561
        }
524
567
        return ss;
525
567
    }
526
567
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
102
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
102
    } else {
519
102
        auto ss = LocalStateType::SharedStateType::create_shared();
520
102
        ss->id = operator_id();
521
102
        for (auto& dest : dests_id()) {
522
101
            ss->related_op_ids.insert(dest);
523
101
        }
524
102
        return ss;
525
102
    }
526
102
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.54M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.54M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.54M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.54M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.54M
    return Status::OK();
534
1.54M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
60.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
60.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
60.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
60.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
60.1k
    return Status::OK();
534
60.1k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
236k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
236k
    auto local_state = LocalStateType::create_unique(state, this);
531
236k
    RETURN_IF_ERROR(local_state->init(state, info));
532
236k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
236k
    return Status::OK();
534
236k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
134
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
134
    auto local_state = LocalStateType::create_unique(state, this);
531
134
    RETURN_IF_ERROR(local_state->init(state, info));
532
134
    state->emplace_local_state(operator_id(), std::move(local_state));
533
134
    return Status::OK();
534
134
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.07k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.07k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.07k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.07k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.07k
    return Status::OK();
534
3.07k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.88k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.88k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.88k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.88k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.88k
    return Status::OK();
534
6.88k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.68k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.68k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.68k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.68k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.68k
    return Status::OK();
534
6.68k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
35
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
35
    auto local_state = LocalStateType::create_unique(state, this);
531
35
    RETURN_IF_ERROR(local_state->init(state, info));
532
35
    state->emplace_local_state(operator_id(), std::move(local_state));
533
35
    return Status::OK();
534
35
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
150k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
150k
    auto local_state = LocalStateType::create_unique(state, this);
531
150k
    RETURN_IF_ERROR(local_state->init(state, info));
532
150k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
150k
    return Status::OK();
534
150k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
80.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
80.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
80.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
80.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
80.3k
    return Status::OK();
534
80.3k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
69.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
69.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
69.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
69.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
69.3k
    return Status::OK();
534
69.3k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_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_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.79k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.79k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.79k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.79k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.79k
    return Status::OK();
534
4.79k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
208k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
208k
    auto local_state = LocalStateType::create_unique(state, this);
531
208k
    RETURN_IF_ERROR(local_state->init(state, info));
532
208k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
208k
    return Status::OK();
534
208k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.35k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.35k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.35k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.35k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.35k
    return Status::OK();
534
1.35k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.84k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.84k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.84k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.84k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.84k
    return Status::OK();
534
5.84k
}
_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.49k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.49k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.49k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.49k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.49k
    return Status::OK();
534
1.49k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
50.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
50.6k
    auto local_state = LocalStateType::create_unique(state, this);
531
50.6k
    RETURN_IF_ERROR(local_state->init(state, info));
532
50.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
50.6k
    return Status::OK();
534
50.6k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.42k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.42k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.42k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.42k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.42k
    return Status::OK();
534
4.42k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
386
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
386
    auto local_state = LocalStateType::create_unique(state, this);
531
386
    RETURN_IF_ERROR(local_state->init(state, info));
532
386
    state->emplace_local_state(operator_id(), std::move(local_state));
533
386
    return Status::OK();
534
386
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.61k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.61k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.61k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.61k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.61k
    return Status::OK();
534
2.61k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.50k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.50k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.50k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.50k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.50k
    return Status::OK();
534
2.50k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
311
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
311
    auto local_state = LocalStateType::create_unique(state, this);
531
311
    RETURN_IF_ERROR(local_state->init(state, info));
532
311
    state->emplace_local_state(operator_id(), std::move(local_state));
533
311
    return Status::OK();
534
311
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.56k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.56k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.56k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.56k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.56k
    return Status::OK();
534
1.56k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.19k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.19k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.19k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.19k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.19k
    return Status::OK();
534
4.19k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
442k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
442k
    auto local_state = LocalStateType::create_unique(state, this);
531
442k
    RETURN_IF_ERROR(local_state->init(state, info));
532
442k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
442k
    return Status::OK();
534
442k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
14
    auto local_state = LocalStateType::create_unique(state, this);
531
14
    RETURN_IF_ERROR(local_state->init(state, info));
532
14
    state->emplace_local_state(operator_id(), std::move(local_state));
533
14
    return Status::OK();
534
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
164
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
164
    auto local_state = LocalStateType::create_unique(state, this);
531
164
    RETURN_IF_ERROR(local_state->init(state, info));
532
164
    state->emplace_local_state(operator_id(), std::move(local_state));
533
164
    return Status::OK();
534
164
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.18k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.18k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.18k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.18k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.18k
    return Status::OK();
534
2.18k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
779
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
779
    auto local_state = LocalStateType::create_unique(state, this);
531
779
    RETURN_IF_ERROR(local_state->init(state, info));
532
779
    state->emplace_local_state(operator_id(), std::move(local_state));
533
779
    return Status::OK();
534
779
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.00k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.00k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.00k
    return Status::OK();
534
1.00k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.02k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.02k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.02k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.02k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.02k
    return Status::OK();
534
5.02k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
195k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
195k
    auto local_state = LocalStateType::create_unique(state, this);
531
195k
    RETURN_IF_ERROR(local_state->init(state, info));
532
195k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
195k
    return Status::OK();
534
195k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.34M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.54M
        : _num_rows_returned(0),
542
1.54M
          _rows_returned_counter(nullptr),
543
1.54M
          _parent(parent),
544
1.54M
          _state(state),
545
1.54M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.54M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.54M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.54M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.54M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.54M
    _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.54M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.54M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.54M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.54M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.54M
    if constexpr (!is_fake_shared) {
560
885k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
519k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
519k
                                    .first.get()
563
519k
                                    ->template cast<SharedStateArg>();
564
565
519k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
519k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
519k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
519k
        } else if (info.shared_state) {
569
308k
            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
308k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
308k
            _dependency = _shared_state->create_source_dependency(
576
308k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
308k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
308k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
308k
        } else {
580
57.6k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
3.84k
                DCHECK(false);
582
3.84k
            }
583
57.6k
        }
584
885k
    }
585
586
1.54M
    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.54M
    _rows_returned_counter =
591
1.54M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.54M
    _blocks_returned_counter =
593
1.54M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.54M
    _output_block_bytes_counter =
595
1.54M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.54M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.54M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.54M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.54M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.54M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.54M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.54M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.54M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.54M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.54M
    _memory_used_counter =
606
1.54M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.54M
    _common_profile->add_info_string("IsColocate",
608
1.54M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.54M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.54M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.54M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.54M
    return Status::OK();
613
1.54M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
60.1k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
60.1k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
60.1k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
60.1k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
60.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
60.1k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
60.1k
    _operator_profile->add_child(_common_profile.get(), true);
557
60.1k
    _operator_profile->add_child(_custom_profile.get(), true);
558
60.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
60.1k
    if constexpr (!is_fake_shared) {
560
60.1k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
9.48k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
9.48k
                                    .first.get()
563
9.48k
                                    ->template cast<SharedStateArg>();
564
565
9.48k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
9.48k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
9.48k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
50.7k
        } 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
50.2k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
50.2k
            _dependency = _shared_state->create_source_dependency(
576
50.2k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
50.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
50.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.2k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
430
        }
584
60.1k
    }
585
586
60.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
60.1k
    _rows_returned_counter =
591
60.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
60.1k
    _blocks_returned_counter =
593
60.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
60.1k
    _output_block_bytes_counter =
595
60.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
60.1k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
60.1k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
60.1k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
60.1k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
60.1k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
60.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
60.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
60.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
60.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
60.1k
    _memory_used_counter =
606
60.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
60.1k
    _common_profile->add_info_string("IsColocate",
608
60.1k
                                     std::to_string(_parent->is_colocated_operator()));
609
60.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
60.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
60.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
60.1k
    return Status::OK();
613
60.1k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1
    _operator_profile->add_child(_common_profile.get(), true);
557
1
    _operator_profile->add_child(_custom_profile.get(), true);
558
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1
    if constexpr (!is_fake_shared) {
560
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
1
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1
            _dependency = _shared_state->create_source_dependency(
576
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
1
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
1
    }
585
586
1
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1
    _rows_returned_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1
    _blocks_returned_counter =
593
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1
    _output_block_bytes_counter =
595
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1
    _memory_used_counter =
606
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1
    _common_profile->add_info_string("IsColocate",
608
1
                                     std::to_string(_parent->is_colocated_operator()));
609
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1
    return Status::OK();
613
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
157k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
157k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
157k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
157k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
157k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
157k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
157k
    _operator_profile->add_child(_common_profile.get(), true);
557
157k
    _operator_profile->add_child(_custom_profile.get(), true);
558
157k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
157k
    if constexpr (!is_fake_shared) {
560
157k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
157k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
154k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
154k
            _dependency = _shared_state->create_source_dependency(
576
154k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
154k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
154k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
154k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
3.11k
        }
584
157k
    }
585
586
157k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
157k
    _rows_returned_counter =
591
157k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
157k
    _blocks_returned_counter =
593
157k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
157k
    _output_block_bytes_counter =
595
157k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
157k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
157k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
157k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
157k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
157k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
157k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
157k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
157k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
157k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
157k
    _memory_used_counter =
606
157k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
157k
    _common_profile->add_info_string("IsColocate",
608
157k
                                     std::to_string(_parent->is_colocated_operator()));
609
157k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
157k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
157k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
157k
    return Status::OK();
613
157k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
35
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
35
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
35
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
35
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
35
    _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
35
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
35
    _operator_profile->add_child(_common_profile.get(), true);
557
35
    _operator_profile->add_child(_custom_profile.get(), true);
558
35
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
35
    if constexpr (!is_fake_shared) {
560
35
        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
35
        } 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
35
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
35
            _dependency = _shared_state->create_source_dependency(
576
35
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
35
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
35
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
35
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
35
    }
585
586
35
    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
35
    _rows_returned_counter =
591
35
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
35
    _blocks_returned_counter =
593
35
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
35
    _output_block_bytes_counter =
595
35
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
35
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
35
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
35
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
35
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
35
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
35
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
35
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
35
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
35
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
35
    _memory_used_counter =
606
35
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
35
    _common_profile->add_info_string("IsColocate",
608
35
                                     std::to_string(_parent->is_colocated_operator()));
609
35
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
35
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
35
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
35
    return Status::OK();
613
35
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.85k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.85k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.85k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.85k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.85k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.85k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.85k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.85k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.85k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.85k
    if constexpr (!is_fake_shared) {
560
5.85k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.85k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.80k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.80k
            _dependency = _shared_state->create_source_dependency(
576
5.80k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.80k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.80k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.80k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
54
        }
584
5.85k
    }
585
586
5.85k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.85k
    _rows_returned_counter =
591
5.85k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.85k
    _blocks_returned_counter =
593
5.85k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.85k
    _output_block_bytes_counter =
595
5.85k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.85k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.85k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.85k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.85k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.85k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.85k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.85k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.85k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.85k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.85k
    _memory_used_counter =
606
5.85k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.85k
    _common_profile->add_info_string("IsColocate",
608
5.85k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.85k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.85k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.85k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.85k
    return Status::OK();
613
5.85k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.95k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.95k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.95k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.95k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.95k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.95k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.95k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.95k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.95k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.95k
    if constexpr (!is_fake_shared) {
560
6.95k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.95k
        } 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.83k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.83k
            _dependency = _shared_state->create_source_dependency(
576
6.83k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.83k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.83k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.83k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
125
        }
584
6.95k
    }
585
586
6.95k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.95k
    _rows_returned_counter =
591
6.95k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.95k
    _blocks_returned_counter =
593
6.95k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.95k
    _output_block_bytes_counter =
595
6.95k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.95k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.95k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.95k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.95k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.95k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.95k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.95k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.95k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.95k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.95k
    _memory_used_counter =
606
6.95k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.95k
    _common_profile->add_info_string("IsColocate",
608
6.95k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.95k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.95k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.95k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.95k
    return Status::OK();
613
6.95k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
80.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
80.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
80.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
80.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
80.5k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
80.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
80.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
80.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
80.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
80.5k
    if constexpr (!is_fake_shared) {
560
80.5k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
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
80.5k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
78.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
78.9k
            _dependency = _shared_state->create_source_dependency(
576
78.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
78.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
78.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
78.9k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.57k
        }
584
80.5k
    }
585
586
80.5k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
80.5k
    _rows_returned_counter =
591
80.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
80.5k
    _blocks_returned_counter =
593
80.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
80.5k
    _output_block_bytes_counter =
595
80.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
80.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
80.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
80.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
80.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
80.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
80.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
80.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
80.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
80.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
80.5k
    _memory_used_counter =
606
80.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
80.5k
    _common_profile->add_info_string("IsColocate",
608
80.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
80.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
80.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
80.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
80.5k
    return Status::OK();
613
80.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
69.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
69.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
69.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
69.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
69.3k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
69.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
69.3k
    _operator_profile->add_child(_common_profile.get(), true);
557
69.3k
    _operator_profile->add_child(_custom_profile.get(), true);
558
69.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
69.3k
    if constexpr (!is_fake_shared) {
560
69.3k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
69.3k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
69.3k
                                    .first.get()
563
69.3k
                                    ->template cast<SharedStateArg>();
564
565
69.3k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
69.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
69.3k
                    _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
69.3k
    }
585
586
69.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
69.3k
    _rows_returned_counter =
591
69.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
69.3k
    _blocks_returned_counter =
593
69.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
69.3k
    _output_block_bytes_counter =
595
69.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
69.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
69.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
69.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
69.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
69.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
69.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
69.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
69.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
69.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
69.3k
    _memory_used_counter =
606
69.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
69.3k
    _common_profile->add_info_string("IsColocate",
608
69.3k
                                     std::to_string(_parent->is_colocated_operator()));
609
69.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
69.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
69.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
69.3k
    return Status::OK();
613
69.3k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_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
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
664k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
664k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
664k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
664k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
664k
    _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
664k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
664k
    _operator_profile->add_child(_common_profile.get(), true);
557
664k
    _operator_profile->add_child(_custom_profile.get(), true);
558
664k
    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
664k
    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
664k
    _rows_returned_counter =
591
664k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
664k
    _blocks_returned_counter =
593
664k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
664k
    _output_block_bytes_counter =
595
664k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
664k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
664k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
664k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
664k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
664k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
664k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
664k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
664k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
664k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
664k
    _memory_used_counter =
606
664k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
664k
    _common_profile->add_info_string("IsColocate",
608
664k
                                     std::to_string(_parent->is_colocated_operator()));
609
664k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
664k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
664k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
664k
    return Status::OK();
613
664k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
50.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
50.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
50.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
50.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
50.6k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
50.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
50.6k
    _operator_profile->add_child(_common_profile.get(), true);
557
50.6k
    _operator_profile->add_child(_custom_profile.get(), true);
558
50.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
50.6k
    if constexpr (!is_fake_shared) {
560
50.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
50.6k
        } 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
2.16k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
2.16k
            _dependency = _shared_state->create_source_dependency(
576
2.16k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
2.16k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
2.16k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
48.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
48.5k
        }
584
50.6k
    }
585
586
50.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
50.6k
    _rows_returned_counter =
591
50.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
50.6k
    _blocks_returned_counter =
593
50.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
50.6k
    _output_block_bytes_counter =
595
50.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
50.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
50.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
50.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
50.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
50.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
50.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
50.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
50.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
50.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
50.6k
    _memory_used_counter =
606
50.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
50.6k
    _common_profile->add_info_string("IsColocate",
608
50.6k
                                     std::to_string(_parent->is_colocated_operator()));
609
50.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
50.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
50.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
50.6k
    return Status::OK();
613
50.6k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
4.42k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
4.42k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
4.42k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
4.42k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
4.42k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
4.42k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
4.42k
    _operator_profile->add_child(_common_profile.get(), true);
557
4.42k
    _operator_profile->add_child(_custom_profile.get(), true);
558
4.42k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
4.42k
    if constexpr (!is_fake_shared) {
560
4.42k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
4.42k
        } 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.41k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.41k
            _dependency = _shared_state->create_source_dependency(
576
4.41k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.41k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.41k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.41k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
11
        }
584
4.42k
    }
585
586
4.42k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
4.42k
    _rows_returned_counter =
591
4.42k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
4.42k
    _blocks_returned_counter =
593
4.42k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
4.42k
    _output_block_bytes_counter =
595
4.42k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
4.42k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
4.42k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
4.42k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
4.42k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
4.42k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
4.42k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
4.42k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
4.42k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
4.42k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
4.42k
    _memory_used_counter =
606
4.42k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
4.42k
    _common_profile->add_info_string("IsColocate",
608
4.42k
                                     std::to_string(_parent->is_colocated_operator()));
609
4.42k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
4.42k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
4.42k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
4.42k
    return Status::OK();
613
4.42k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
489
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
489
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
489
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
489
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
489
    _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
489
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
489
    _operator_profile->add_child(_common_profile.get(), true);
557
489
    _operator_profile->add_child(_custom_profile.get(), true);
558
489
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
489
    if constexpr (!is_fake_shared) {
560
489
        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
489
        } 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
486
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
486
            _dependency = _shared_state->create_source_dependency(
576
486
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
486
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
486
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
486
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
3
        }
584
489
    }
585
586
489
    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
489
    _rows_returned_counter =
591
489
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
489
    _blocks_returned_counter =
593
489
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
489
    _output_block_bytes_counter =
595
489
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
489
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
489
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
489
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
489
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
489
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
489
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
489
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
489
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
489
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
489
    _memory_used_counter =
606
489
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
489
    _common_profile->add_info_string("IsColocate",
608
489
                                     std::to_string(_parent->is_colocated_operator()));
609
489
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
489
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
489
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
489
    return Status::OK();
613
489
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.13k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.13k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.13k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.13k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.13k
    _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.13k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.13k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.13k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.13k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.13k
    if constexpr (!is_fake_shared) {
560
5.13k
        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.13k
        } 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.09k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.09k
            _dependency = _shared_state->create_source_dependency(
576
5.09k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.09k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.09k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.09k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
36
        }
584
5.13k
    }
585
586
5.13k
    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.13k
    _rows_returned_counter =
591
5.13k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.13k
    _blocks_returned_counter =
593
5.13k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.13k
    _output_block_bytes_counter =
595
5.13k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.13k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.13k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.13k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.13k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.13k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.13k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.13k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.13k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.13k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.13k
    _memory_used_counter =
606
5.13k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.13k
    _common_profile->add_info_string("IsColocate",
608
5.13k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.13k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.13k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.13k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.13k
    return Status::OK();
613
5.13k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
444k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
444k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
444k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
444k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
444k
    _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
444k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
444k
    _operator_profile->add_child(_common_profile.get(), true);
557
444k
    _operator_profile->add_child(_custom_profile.get(), true);
558
444k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
444k
    if constexpr (!is_fake_shared) {
560
444k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
440k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
440k
                                    .first.get()
563
440k
                                    ->template cast<SharedStateArg>();
564
565
440k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
440k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
440k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
440k
        } 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
3.84k
        } else {
580
3.84k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
3.84k
                DCHECK(false);
582
3.84k
            }
583
3.84k
        }
584
444k
    }
585
586
444k
    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
444k
    _rows_returned_counter =
591
444k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
444k
    _blocks_returned_counter =
593
444k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
444k
    _output_block_bytes_counter =
595
444k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
444k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
444k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
444k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
444k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
444k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
444k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
444k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
444k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
444k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
444k
    _memory_used_counter =
606
444k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
444k
    _common_profile->add_info_string("IsColocate",
608
444k
                                     std::to_string(_parent->is_colocated_operator()));
609
444k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
444k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
444k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
444k
    return Status::OK();
613
444k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
164
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
164
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
164
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
164
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
164
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
164
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
164
    _operator_profile->add_child(_common_profile.get(), true);
557
164
    _operator_profile->add_child(_custom_profile.get(), true);
558
164
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
164
    if constexpr (!is_fake_shared) {
560
164
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
164
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
164
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
164
            _dependency = _shared_state->create_source_dependency(
576
164
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
164
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
164
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
164
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
164
    }
585
586
164
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
164
    _rows_returned_counter =
591
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
164
    _blocks_returned_counter =
593
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
164
    _output_block_bytes_counter =
595
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
164
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
164
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
164
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
164
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
164
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
164
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
164
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
164
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
164
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
164
    _memory_used_counter =
606
164
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
164
    _common_profile->add_info_string("IsColocate",
608
164
                                     std::to_string(_parent->is_colocated_operator()));
609
164
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
164
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
164
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
164
    return Status::OK();
613
164
}
614
615
template <typename SharedStateArg>
616
1.55M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.55M
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.83M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
276k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
276k
    }
621
1.55M
    if (_parent->has_projection()) {
622
345k
        const auto& projection = *_parent->_projection;
623
345k
        _projections.resize(projection.projections.size());
624
2.10M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.75M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.75M
        }
627
345k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
355k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
10.0k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
59.4k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
49.3k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
49.3k
                        state, _intermediate_projections[i][j]));
633
49.3k
            }
634
10.0k
        }
635
345k
    }
636
1.55M
    return Status::OK();
637
1.55M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
60.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
60.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
60.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
564
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
564
    }
621
60.3k
    if (_parent->has_projection()) {
622
60.3k
        const auto& projection = *_parent->_projection;
623
60.3k
        _projections.resize(projection.projections.size());
624
294k
        for (size_t i = 0; i < _projections.size(); i++) {
625
234k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
234k
        }
627
60.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
61.1k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
805
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
6.52k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
5.72k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
5.72k
                        state, _intermediate_projections[i][j]));
633
5.72k
            }
634
805
        }
635
60.3k
    }
636
60.3k
    return Status::OK();
637
60.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
157k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
157k
    _conjuncts.resize(_parent->_conjuncts.size());
618
157k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
157k
    if (_parent->has_projection()) {
622
75
        const auto& projection = *_parent->_projection;
623
75
        _projections.resize(projection.projections.size());
624
371
        for (size_t i = 0; i < _projections.size(); i++) {
625
296
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
296
        }
627
75
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
75
        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
75
    }
636
157k
    return Status::OK();
637
157k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
35
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
35
    _conjuncts.resize(_parent->_conjuncts.size());
618
35
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
35
    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
35
    return Status::OK();
637
35
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.92k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.92k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.01k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
83
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
83
    }
621
5.93k
    if (_parent->has_projection()) {
622
5.93k
        const auto& projection = *_parent->_projection;
623
5.93k
        _projections.resize(projection.projections.size());
624
24.6k
        for (size_t i = 0; i < _projections.size(); i++) {
625
18.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
18.7k
        }
627
5.93k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.95k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
20
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
138
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
118
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
118
                        state, _intermediate_projections[i][j]));
633
118
            }
634
20
        }
635
5.93k
    }
636
5.92k
    return Status::OK();
637
5.92k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.98k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.98k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.69k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
716
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
716
    }
621
6.98k
    if (_parent->has_projection()) {
622
3.86k
        const auto& projection = *_parent->_projection;
623
3.86k
        _projections.resize(projection.projections.size());
624
15.7k
        for (size_t i = 0; i < _projections.size(); i++) {
625
11.9k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
11.9k
        }
627
3.86k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
3.95k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
94
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
714
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
620
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
620
                        state, _intermediate_projections[i][j]));
633
620
            }
634
94
        }
635
3.86k
    }
636
6.98k
    return Status::OK();
637
6.98k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
80.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
80.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
82.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.62k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.62k
    }
621
80.8k
    if (_parent->has_projection()) {
622
26.0k
        const auto& projection = *_parent->_projection;
623
26.0k
        _projections.resize(projection.projections.size());
624
231k
        for (size_t i = 0; i < _projections.size(); i++) {
625
205k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
205k
        }
627
26.0k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
26.1k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
115
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
668
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
553
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
553
                        state, _intermediate_projections[i][j]));
633
553
            }
634
115
        }
635
26.0k
    }
636
80.8k
    return Status::OK();
637
80.8k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
69.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
69.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
69.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
5
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
5
    }
621
69.4k
    if (_parent->has_projection()) {
622
124
        const auto& projection = *_parent->_projection;
623
124
        _projections.resize(projection.projections.size());
624
593
        for (size_t i = 0; i < _projections.size(); i++) {
625
469
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
469
        }
627
124
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
126
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
2
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
15
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
13
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
13
                        state, _intermediate_projections[i][j]));
633
13
            }
634
2
        }
635
124
    }
636
69.4k
    return Status::OK();
637
69.4k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
171
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
171
    _conjuncts.resize(_parent->_conjuncts.size());
618
171
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
171
    if (_parent->has_projection()) {
622
126
        const auto& projection = *_parent->_projection;
623
126
        _projections.resize(projection.projections.size());
624
378
        for (size_t i = 0; i < _projections.size(); i++) {
625
252
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
252
        }
627
126
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
126
        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
126
    }
636
171
    return Status::OK();
637
171
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
668k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
668k
    _conjuncts.resize(_parent->_conjuncts.size());
618
941k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
273k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
273k
    }
621
668k
    if (_parent->has_projection()) {
622
239k
        const auto& projection = *_parent->_projection;
623
239k
        _projections.resize(projection.projections.size());
624
1.44M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.20M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.20M
        }
627
239k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
248k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
8.99k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
51.3k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
42.3k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
42.3k
                        state, _intermediate_projections[i][j]));
633
42.3k
            }
634
8.99k
        }
635
239k
    }
636
668k
    return Status::OK();
637
668k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
50.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
50.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
50.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
50.8k
    if (_parent->has_projection()) {
622
9.65k
        const auto& projection = *_parent->_projection;
623
9.65k
        _projections.resize(projection.projections.size());
624
94.6k
        for (size_t i = 0; i < _projections.size(); i++) {
625
84.9k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
84.9k
        }
627
9.65k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
9.65k
        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
9.65k
    }
636
50.8k
    return Status::OK();
637
50.8k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
4.41k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
4.41k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.16k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
750
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
750
    }
621
4.41k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
4.41k
    return Status::OK();
637
4.41k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
491
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
491
    _conjuncts.resize(_parent->_conjuncts.size());
618
491
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
491
    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
491
    return Status::OK();
637
491
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.13k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.13k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.13k
    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.13k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
227
        for (size_t i = 0; i < _projections.size(); i++) {
625
167
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
167
        }
627
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
60
    }
636
5.13k
    return Status::OK();
637
5.13k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
446k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
446k
    _conjuncts.resize(_parent->_conjuncts.size());
618
446k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
446k
    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
446k
    return Status::OK();
637
446k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
164
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
164
    _conjuncts.resize(_parent->_conjuncts.size());
618
171
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
164
    if (_parent->has_projection()) {
622
161
        const auto& projection = *_parent->_projection;
623
161
        _projections.resize(projection.projections.size());
624
480
        for (size_t i = 0; i < _projections.size(); i++) {
625
319
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
319
        }
627
161
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
164
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
161
    }
636
164
    return Status::OK();
637
164
}
638
639
template <typename SharedStateArg>
640
7.90k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.90k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7.90k
    _terminated = true;
645
7.90k
    return Status::OK();
646
7.90k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
406
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
406
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
406
    _terminated = true;
645
406
    return Status::OK();
646
406
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
12
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
12
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
12
    _terminated = true;
645
12
    return Status::OK();
646
12
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
101
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
101
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
101
    _terminated = true;
645
101
    return Status::OK();
646
101
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
5
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
5
    _terminated = true;
645
5
    return Status::OK();
646
5
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
234
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
234
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
234
    _terminated = true;
645
234
    return Status::OK();
646
234
}
_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
6.11k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.11k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.11k
    _terminated = true;
645
6.11k
    return Status::OK();
646
6.11k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
10
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
10
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
10
    _terminated = true;
645
10
    return Status::OK();
646
10
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
7
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7
    _terminated = true;
645
7
    return Status::OK();
646
7
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
982
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
982
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
982
    _terminated = true;
645
982
    return Status::OK();
646
982
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
35
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
35
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
35
    _terminated = true;
645
35
    return Status::OK();
646
35
}
647
648
template <typename SharedStateArg>
649
1.74M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
1.74M
    if (_closed) {
651
186k
        return Status::OK();
652
186k
    }
653
1.55M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
887k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
887k
    }
656
1.55M
    _closed = true;
657
1.55M
    return Status::OK();
658
1.74M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
60.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
60.2k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
60.2k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
60.2k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
60.2k
    }
656
60.2k
    _closed = true;
657
60.2k
    return Status::OK();
658
60.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
313k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
313k
    if (_closed) {
651
157k
        return Status::OK();
652
157k
    }
653
156k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
156k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
156k
    }
656
156k
    _closed = true;
657
156k
    return Status::OK();
658
313k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
35
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
35
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
35
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
35
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
35
    }
656
35
    _closed = true;
657
35
    return Status::OK();
658
35
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.92k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.92k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.92k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.92k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.92k
    }
656
5.92k
    _closed = true;
657
5.92k
    return Status::OK();
658
5.92k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
14.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
14.0k
    if (_closed) {
651
7.10k
        return Status::OK();
652
7.10k
    }
653
6.96k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.96k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.96k
    }
656
6.96k
    _closed = true;
657
6.96k
    return Status::OK();
658
14.0k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
80.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
80.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
80.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
80.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
80.6k
    }
656
80.6k
    _closed = true;
657
80.6k
    return Status::OK();
658
80.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
69.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
69.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
69.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
69.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
69.0k
    }
656
69.0k
    _closed = true;
657
69.0k
    return Status::OK();
658
69.0k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
167
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
167
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
167
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
167
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
167
    }
656
167
    _closed = true;
657
167
    return Status::OK();
658
167
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
684k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
684k
    if (_closed) {
651
15.8k
        return Status::OK();
652
15.8k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
668k
    _closed = true;
657
668k
    return Status::OK();
658
684k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
50.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
50.7k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
50.7k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
50.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
50.7k
    }
656
50.7k
    _closed = true;
657
50.7k
    return Status::OK();
658
50.7k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4.39k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4.39k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4.39k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4.39k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4.39k
    }
656
4.39k
    _closed = true;
657
4.39k
    return Status::OK();
658
4.39k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
777
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
777
    if (_closed) {
651
389
        return Status::OK();
652
389
    }
653
388
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
388
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
388
    }
656
388
    _closed = true;
657
388
    return Status::OK();
658
777
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.5k
    if (_closed) {
651
5.42k
        return Status::OK();
652
5.42k
    }
653
5.12k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.12k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.12k
    }
656
5.12k
    _closed = true;
657
5.12k
    return Status::OK();
658
10.5k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
447k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
447k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
447k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
447k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
447k
    }
656
447k
    _closed = true;
657
447k
    return Status::OK();
658
447k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
323
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
323
    if (_closed) {
651
168
        return Status::OK();
652
168
    }
653
155
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
155
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
155
    }
656
155
    _closed = true;
657
155
    return Status::OK();
658
323
}
659
660
template <typename SharedState>
661
1.34M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.34M
    _operator_profile =
664
1.34M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.34M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.34M
    _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.34M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.34M
    _operator_profile->add_child(_common_profile, true);
673
1.34M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.34M
    _operator_profile->set_metadata(_parent->node_id());
676
1.34M
    _wait_for_finish_dependency_timer =
677
1.34M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.34M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.34M
    if constexpr (!is_fake_shared) {
680
978k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
978k
            info.shared_state_map.end()) {
682
259k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
180k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
180k
            }
685
259k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
259k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
259k
                                                  ? 0
688
259k
                                                  : info.task_idx]
689
259k
                                  .get();
690
259k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
718k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
718k
            _shared_state = info.shared_state->template cast<SharedState>();
696
718k
            _dependency = _shared_state->create_sink_dependency(
697
718k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
718k
        }
699
978k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
978k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
978k
    }
702
703
1.34M
    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.34M
    _rows_input_counter =
708
1.34M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.34M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.34M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.34M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.34M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.34M
    _memory_used_counter =
714
1.34M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.34M
    _common_profile->add_info_string("IsColocate",
716
1.34M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.34M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.34M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.34M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.34M
    return Status::OK();
721
1.34M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
108k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
108k
    _operator_profile =
664
108k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
108k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
108k
    _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
108k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
108k
    _operator_profile->add_child(_common_profile, true);
673
108k
    _operator_profile->add_child(_custom_profile, true);
674
675
108k
    _operator_profile->set_metadata(_parent->node_id());
676
108k
    _wait_for_finish_dependency_timer =
677
108k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
108k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
108k
    if constexpr (!is_fake_shared) {
680
108k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
108k
            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
9.60k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
9.60k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
9.60k
                                                  ? 0
688
9.60k
                                                  : info.task_idx]
689
9.60k
                                  .get();
690
9.60k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
98.6k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
98.6k
            _shared_state = info.shared_state->template cast<SharedState>();
696
98.6k
            _dependency = _shared_state->create_sink_dependency(
697
98.6k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
98.6k
        }
699
108k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
108k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
108k
    }
702
703
108k
    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
108k
    _rows_input_counter =
708
108k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
108k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
108k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
108k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
108k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
108k
    _memory_used_counter =
714
108k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
108k
    _common_profile->add_info_string("IsColocate",
716
108k
                                     std::to_string(_parent->is_colocated_operator()));
717
108k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
108k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
108k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
108k
    return Status::OK();
721
108k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2
    _operator_profile =
664
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2
    _operator_profile->add_child(_common_profile, true);
673
2
    _operator_profile->add_child(_custom_profile, true);
674
675
2
    _operator_profile->set_metadata(_parent->node_id());
676
2
    _wait_for_finish_dependency_timer =
677
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2
    if constexpr (!is_fake_shared) {
680
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2
            _shared_state = info.shared_state->template cast<SharedState>();
696
2
            _dependency = _shared_state->create_sink_dependency(
697
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2
        }
699
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2
    }
702
703
2
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2
    _rows_input_counter =
708
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2
    _memory_used_counter =
714
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2
    _common_profile->add_info_string("IsColocate",
716
2
                                     std::to_string(_parent->is_colocated_operator()));
717
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2
    return Status::OK();
721
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
157k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
157k
    _operator_profile =
664
157k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
157k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
157k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
157k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
157k
    _operator_profile->add_child(_common_profile, true);
673
157k
    _operator_profile->add_child(_custom_profile, true);
674
675
157k
    _operator_profile->set_metadata(_parent->node_id());
676
157k
    _wait_for_finish_dependency_timer =
677
157k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
157k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
157k
    if constexpr (!is_fake_shared) {
680
157k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
157k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
157k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
157k
            _shared_state = info.shared_state->template cast<SharedState>();
696
157k
            _dependency = _shared_state->create_sink_dependency(
697
157k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
157k
        }
699
157k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
157k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
157k
    }
702
703
157k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
157k
    _rows_input_counter =
708
157k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
157k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
157k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
157k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
157k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
157k
    _memory_used_counter =
714
157k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
157k
    _common_profile->add_info_string("IsColocate",
716
157k
                                     std::to_string(_parent->is_colocated_operator()));
717
157k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
157k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
157k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
157k
    return Status::OK();
721
157k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
42
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
42
    _operator_profile =
664
42
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
42
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
42
    _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
42
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
42
    _operator_profile->add_child(_common_profile, true);
673
42
    _operator_profile->add_child(_custom_profile, true);
674
675
42
    _operator_profile->set_metadata(_parent->node_id());
676
42
    _wait_for_finish_dependency_timer =
677
42
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
42
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
42
    if constexpr (!is_fake_shared) {
680
42
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
42
            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
42
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
42
            _shared_state = info.shared_state->template cast<SharedState>();
696
42
            _dependency = _shared_state->create_sink_dependency(
697
42
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
42
        }
699
42
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
42
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
42
    }
702
703
42
    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
42
    _rows_input_counter =
708
42
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
42
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
42
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
42
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
42
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
42
    _memory_used_counter =
714
42
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
42
    _common_profile->add_info_string("IsColocate",
716
42
                                     std::to_string(_parent->is_colocated_operator()));
717
42
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
42
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
42
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
42
    return Status::OK();
721
42
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.89k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.89k
    _operator_profile =
664
5.89k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.89k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.89k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
5.89k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.89k
    _operator_profile->add_child(_common_profile, true);
673
5.89k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.89k
    _operator_profile->set_metadata(_parent->node_id());
676
5.89k
    _wait_for_finish_dependency_timer =
677
5.89k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.89k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.89k
    if constexpr (!is_fake_shared) {
680
5.89k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.89k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
5.89k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.89k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.89k
            _dependency = _shared_state->create_sink_dependency(
697
5.89k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.89k
        }
699
5.89k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.89k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.89k
    }
702
703
5.89k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
5.89k
    _rows_input_counter =
708
5.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.89k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.89k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.89k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.89k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.89k
    _memory_used_counter =
714
5.89k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.89k
    _common_profile->add_info_string("IsColocate",
716
5.89k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.89k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.89k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.89k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.89k
    return Status::OK();
721
5.89k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.94k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.94k
    _operator_profile =
664
6.94k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.94k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.94k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
6.94k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.94k
    _operator_profile->add_child(_common_profile, true);
673
6.94k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.94k
    _operator_profile->set_metadata(_parent->node_id());
676
6.94k
    _wait_for_finish_dependency_timer =
677
6.94k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.94k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.94k
    if constexpr (!is_fake_shared) {
680
6.94k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.94k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
6.94k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.94k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.94k
            _dependency = _shared_state->create_sink_dependency(
697
6.94k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.94k
        }
699
6.94k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.94k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.94k
    }
702
703
6.94k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
6.94k
    _rows_input_counter =
708
6.94k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.94k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.94k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.94k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.94k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.94k
    _memory_used_counter =
714
6.94k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.94k
    _common_profile->add_info_string("IsColocate",
716
6.94k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.94k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.94k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.94k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.94k
    return Status::OK();
721
6.94k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
80.6k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
80.6k
    _operator_profile =
664
80.6k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
80.6k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
80.6k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
80.6k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
80.6k
    _operator_profile->add_child(_common_profile, true);
673
80.6k
    _operator_profile->add_child(_custom_profile, true);
674
675
80.6k
    _operator_profile->set_metadata(_parent->node_id());
676
80.6k
    _wait_for_finish_dependency_timer =
677
80.6k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
80.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
80.6k
    if constexpr (!is_fake_shared) {
680
80.6k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
80.6k
            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
80.6k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
80.6k
            _shared_state = info.shared_state->template cast<SharedState>();
696
80.6k
            _dependency = _shared_state->create_sink_dependency(
697
80.6k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
80.6k
        }
699
80.6k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
80.6k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
80.6k
    }
702
703
80.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
80.6k
    _rows_input_counter =
708
80.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
80.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
80.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
80.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
80.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
80.6k
    _memory_used_counter =
714
80.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
80.6k
    _common_profile->add_info_string("IsColocate",
716
80.6k
                                     std::to_string(_parent->is_colocated_operator()));
717
80.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
80.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
80.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
80.6k
    return Status::OK();
721
80.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
69.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
69.3k
    _operator_profile =
664
69.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
69.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
69.3k
    _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
69.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
69.3k
    _operator_profile->add_child(_common_profile, true);
673
69.3k
    _operator_profile->add_child(_custom_profile, true);
674
675
69.3k
    _operator_profile->set_metadata(_parent->node_id());
676
69.3k
    _wait_for_finish_dependency_timer =
677
69.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
69.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
69.3k
    if constexpr (!is_fake_shared) {
680
69.3k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
69.3k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
69.3k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
69.3k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
69.3k
                                                  ? 0
688
69.3k
                                                  : info.task_idx]
689
69.3k
                                  .get();
690
69.3k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
69.3k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
69.3k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
69.3k
    }
702
703
69.3k
    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
69.3k
    _rows_input_counter =
708
69.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
69.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
69.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
69.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
69.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
69.3k
    _memory_used_counter =
714
69.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
69.3k
    _common_profile->add_info_string("IsColocate",
716
69.3k
                                     std::to_string(_parent->is_colocated_operator()));
717
69.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
69.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
69.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
69.3k
    return Status::OK();
721
69.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
178
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
178
    _operator_profile =
664
178
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
178
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
178
    _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
178
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
178
    _operator_profile->add_child(_common_profile, true);
673
178
    _operator_profile->add_child(_custom_profile, true);
674
675
178
    _operator_profile->set_metadata(_parent->node_id());
676
178
    _wait_for_finish_dependency_timer =
677
178
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
178
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
178
    if constexpr (!is_fake_shared) {
680
178
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
178
            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
178
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
178
            _shared_state = info.shared_state->template cast<SharedState>();
696
178
            _dependency = _shared_state->create_sink_dependency(
697
178
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
178
        }
699
178
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
178
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
178
    }
702
703
178
    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
178
    _rows_input_counter =
708
178
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
178
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
178
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
178
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
178
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
178
    _memory_used_counter =
714
178
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
178
    _common_profile->add_info_string("IsColocate",
716
178
                                     std::to_string(_parent->is_colocated_operator()));
717
178
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
178
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
178
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
178
    return Status::OK();
721
178
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
369k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
369k
    _operator_profile =
664
369k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
369k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
369k
    _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
369k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
369k
    _operator_profile->add_child(_common_profile, true);
673
369k
    _operator_profile->add_child(_custom_profile, true);
674
675
369k
    _operator_profile->set_metadata(_parent->node_id());
676
369k
    _wait_for_finish_dependency_timer =
677
369k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
369k
    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
369k
    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
369k
    _rows_input_counter =
708
369k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
369k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
369k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
369k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
369k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
369k
    _memory_used_counter =
714
369k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
369k
    _common_profile->add_info_string("IsColocate",
716
369k
                                     std::to_string(_parent->is_colocated_operator()));
717
369k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
369k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
369k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
369k
    return Status::OK();
721
369k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
4.59k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
4.59k
    _operator_profile =
664
4.59k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
4.59k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
4.59k
    _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
4.59k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
4.59k
    _operator_profile->add_child(_common_profile, true);
673
4.59k
    _operator_profile->add_child(_custom_profile, true);
674
675
4.59k
    _operator_profile->set_metadata(_parent->node_id());
676
4.59k
    _wait_for_finish_dependency_timer =
677
4.59k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
4.59k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
4.59k
    if constexpr (!is_fake_shared) {
680
4.59k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
4.59k
            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
4.59k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
4.59k
            _shared_state = info.shared_state->template cast<SharedState>();
696
4.59k
            _dependency = _shared_state->create_sink_dependency(
697
4.59k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
4.59k
        }
699
4.59k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
4.59k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
4.59k
    }
702
703
4.59k
    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
4.59k
    _rows_input_counter =
708
4.59k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
4.59k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
4.59k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
4.59k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
4.59k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
4.59k
    _memory_used_counter =
714
4.59k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
4.59k
    _common_profile->add_info_string("IsColocate",
716
4.59k
                                     std::to_string(_parent->is_colocated_operator()));
717
4.59k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
4.59k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
4.59k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
4.59k
    return Status::OK();
721
4.59k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
491
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
491
    _operator_profile =
664
491
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
491
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
491
    _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
491
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
491
    _operator_profile->add_child(_common_profile, true);
673
491
    _operator_profile->add_child(_custom_profile, true);
674
675
491
    _operator_profile->set_metadata(_parent->node_id());
676
491
    _wait_for_finish_dependency_timer =
677
491
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
491
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
491
    if constexpr (!is_fake_shared) {
680
491
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
491
            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
491
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
491
            _shared_state = info.shared_state->template cast<SharedState>();
696
491
            _dependency = _shared_state->create_sink_dependency(
697
491
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
491
        }
699
491
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
491
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
491
    }
702
703
491
    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
491
    _rows_input_counter =
708
491
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
491
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
491
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
491
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
491
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
491
    _memory_used_counter =
714
491
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
491
    _common_profile->add_info_string("IsColocate",
716
491
                                     std::to_string(_parent->is_colocated_operator()));
717
491
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
491
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
491
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
491
    return Status::OK();
721
491
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
1.83k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.83k
    _operator_profile =
664
1.83k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.83k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.83k
    _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.83k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.83k
    _operator_profile->add_child(_common_profile, true);
673
1.83k
    _operator_profile->add_child(_custom_profile, true);
674
675
1.83k
    _operator_profile->set_metadata(_parent->node_id());
676
1.83k
    _wait_for_finish_dependency_timer =
677
1.83k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.83k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.83k
    if constexpr (!is_fake_shared) {
680
1.83k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.83k
            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.83k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
1.83k
            _shared_state = info.shared_state->template cast<SharedState>();
696
1.83k
            _dependency = _shared_state->create_sink_dependency(
697
1.83k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
1.83k
        }
699
1.83k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.83k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.83k
    }
702
703
1.83k
    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.83k
    _rows_input_counter =
708
1.83k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.83k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.83k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.83k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.83k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.83k
    _memory_used_counter =
714
1.83k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.83k
    _common_profile->add_info_string("IsColocate",
716
1.83k
                                     std::to_string(_parent->is_colocated_operator()));
717
1.83k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.83k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.83k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.83k
    return Status::OK();
721
1.83k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.4k
    _operator_profile =
664
12.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.4k
    _operator_profile->add_child(_common_profile, true);
673
12.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.4k
    _operator_profile->set_metadata(_parent->node_id());
676
12.4k
    _wait_for_finish_dependency_timer =
677
12.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.4k
    if constexpr (!is_fake_shared) {
680
12.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.4k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.4k
            _dependency = _shared_state->create_sink_dependency(
697
12.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.4k
        }
699
12.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.4k
    }
702
703
12.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.4k
    _rows_input_counter =
708
12.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.4k
    _memory_used_counter =
714
12.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.4k
    _common_profile->add_info_string("IsColocate",
716
12.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.4k
    return Status::OK();
721
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
180k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
180k
    _operator_profile =
664
180k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
180k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
180k
    _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
180k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
180k
    _operator_profile->add_child(_common_profile, true);
673
180k
    _operator_profile->add_child(_custom_profile, true);
674
675
180k
    _operator_profile->set_metadata(_parent->node_id());
676
180k
    _wait_for_finish_dependency_timer =
677
180k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
180k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
180k
    if constexpr (!is_fake_shared) {
680
180k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
180k
            info.shared_state_map.end()) {
682
180k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
180k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
180k
            }
685
180k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
180k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
180k
                                                  ? 0
688
180k
                                                  : info.task_idx]
689
180k
                                  .get();
690
180k
            _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
180k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
180k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
180k
    }
702
703
180k
    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
180k
    _rows_input_counter =
708
180k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
180k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
180k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
180k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
180k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
180k
    _memory_used_counter =
714
180k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
180k
    _common_profile->add_info_string("IsColocate",
716
180k
                                     std::to_string(_parent->is_colocated_operator()));
717
180k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
180k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
180k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
180k
    return Status::OK();
721
180k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
349k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
349k
    _operator_profile =
664
349k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
349k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
349k
    _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
349k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
349k
    _operator_profile->add_child(_common_profile, true);
673
349k
    _operator_profile->add_child(_custom_profile, true);
674
675
349k
    _operator_profile->set_metadata(_parent->node_id());
676
349k
    _wait_for_finish_dependency_timer =
677
349k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
349k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
349k
    if constexpr (!is_fake_shared) {
680
349k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
349k
            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
349k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
349k
            _shared_state = info.shared_state->template cast<SharedState>();
696
349k
            _dependency = _shared_state->create_sink_dependency(
697
349k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
349k
        }
699
349k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
349k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
349k
    }
702
703
349k
    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
349k
    _rows_input_counter =
708
349k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
349k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
349k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
349k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
349k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
349k
    _memory_used_counter =
714
349k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
349k
    _common_profile->add_info_string("IsColocate",
716
349k
                                     std::to_string(_parent->is_colocated_operator()));
717
349k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
349k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
349k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
349k
    return Status::OK();
721
349k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
25
    _operator_profile =
664
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
25
    _operator_profile->add_child(_common_profile, true);
673
25
    _operator_profile->add_child(_custom_profile, true);
674
675
25
    _operator_profile->set_metadata(_parent->node_id());
676
25
    _wait_for_finish_dependency_timer =
677
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
25
    if constexpr (!is_fake_shared) {
680
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
25
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
25
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
25
            _shared_state = info.shared_state->template cast<SharedState>();
696
25
            _dependency = _shared_state->create_sink_dependency(
697
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
25
        }
699
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
25
    }
702
703
25
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
25
    _rows_input_counter =
708
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
25
    _memory_used_counter =
714
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
25
    _common_profile->add_info_string("IsColocate",
716
25
                                     std::to_string(_parent->is_colocated_operator()));
717
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
25
    return Status::OK();
721
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
328
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
328
    _operator_profile =
664
328
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
328
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
328
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
328
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
328
    _operator_profile->add_child(_common_profile, true);
673
328
    _operator_profile->add_child(_custom_profile, true);
674
675
328
    _operator_profile->set_metadata(_parent->node_id());
676
328
    _wait_for_finish_dependency_timer =
677
328
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
328
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
328
    if constexpr (!is_fake_shared) {
680
328
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
328
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
328
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
328
            _shared_state = info.shared_state->template cast<SharedState>();
696
328
            _dependency = _shared_state->create_sink_dependency(
697
328
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
328
        }
699
328
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
328
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
328
    }
702
703
328
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
328
    _rows_input_counter =
708
328
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
328
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
328
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
328
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
328
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
328
    _memory_used_counter =
714
328
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
328
    _common_profile->add_info_string("IsColocate",
716
328
                                     std::to_string(_parent->is_colocated_operator()));
717
328
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
328
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
328
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
328
    return Status::OK();
721
328
}
722
723
template <typename SharedState>
724
1.35M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.35M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.35M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
979k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
979k
    }
731
1.35M
    _closed = true;
732
1.35M
    return Status::OK();
733
1.35M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
108k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
108k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
108k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
108k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
108k
    }
731
108k
    _closed = true;
732
108k
    return Status::OK();
733
108k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1
    }
731
1
    _closed = true;
732
1
    return Status::OK();
733
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
157k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
157k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
157k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
157k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
157k
    }
731
157k
    _closed = true;
732
157k
    return Status::OK();
733
157k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
31
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
31
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
29
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
29
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
29
    }
731
29
    _closed = true;
732
29
    return Status::OK();
733
31
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.92k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.92k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.92k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.92k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.92k
    }
731
5.92k
    _closed = true;
732
5.92k
    return Status::OK();
733
5.92k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.95k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.95k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.95k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.95k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.95k
    }
731
6.95k
    _closed = true;
732
6.95k
    return Status::OK();
733
6.95k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
80.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
80.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
80.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
80.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
80.4k
    }
731
80.4k
    _closed = true;
732
80.4k
    return Status::OK();
733
80.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
69.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
69.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
69.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
69.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
69.0k
    }
731
69.0k
    _closed = true;
732
69.0k
    return Status::OK();
733
69.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
167
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
167
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
167
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
167
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
167
    }
731
167
    _closed = true;
732
167
    return Status::OK();
733
167
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
372k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
372k
    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
372k
    _closed = true;
732
372k
    return Status::OK();
733
372k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
4.60k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
4.60k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
4.60k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
4.60k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
4.60k
    }
731
4.60k
    _closed = true;
732
4.60k
    return Status::OK();
733
4.60k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
388
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
388
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
388
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
388
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
388
    }
731
388
    _closed = true;
732
388
    return Status::OK();
733
388
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1.82k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.82k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1.82k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.82k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.82k
    }
731
1.82k
    _closed = true;
732
1.82k
    return Status::OK();
733
1.82k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.4k
    }
731
12.4k
    _closed = true;
732
12.4k
    return Status::OK();
733
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
181k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
181k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
181k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
181k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
181k
    }
731
181k
    _closed = true;
732
181k
    return Status::OK();
733
181k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
350k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
350k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
350k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
350k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
350k
    }
731
350k
    _closed = true;
732
350k
    return Status::OK();
733
350k
}
_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
327
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
327
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
327
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
327
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
327
    }
731
327
    _closed = true;
732
327
    return Status::OK();
733
327
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
9.50k
                                                          bool* eos) {
738
9.50k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
9.50k
    return pull(state, block, eos);
740
9.50k
}
_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
9.46k
                                                          bool* eos) {
738
9.46k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
9.46k
    return pull(state, block, eos);
740
9.46k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
415k
                                                         bool* eos) {
745
415k
    auto& local_state = get_local_state(state);
746
415k
    if (need_more_input_data(state)) {
747
388k
        local_state._child_block->clear_column_data(
748
388k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
388k
                        .num_materialized_slots());
750
388k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
388k
                state, local_state._child_block.get(), &local_state._child_eos));
752
388k
        *eos = local_state._child_eos;
753
388k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
65.6k
            return Status::OK();
755
65.6k
        }
756
322k
        {
757
322k
            SCOPED_TIMER(local_state.exec_time_counter());
758
322k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
322k
        }
760
322k
    }
761
762
350k
    if (!need_more_input_data(state)) {
763
328k
        SCOPED_TIMER(local_state.exec_time_counter());
764
328k
        bool new_eos = false;
765
328k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
328k
        if (new_eos) {
767
249k
            *eos = true;
768
249k
        } else if (!need_more_input_data(state)) {
769
22.6k
            *eos = false;
770
22.6k
        }
771
328k
    }
772
350k
    return Status::OK();
773
350k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
131k
                                                         bool* eos) {
745
131k
    auto& local_state = get_local_state(state);
746
131k
    if (need_more_input_data(state)) {
747
117k
        local_state._child_block->clear_column_data(
748
117k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
117k
                        .num_materialized_slots());
750
117k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
117k
                state, local_state._child_block.get(), &local_state._child_eos));
752
117k
        *eos = local_state._child_eos;
753
117k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
37.5k
            return Status::OK();
755
37.5k
        }
756
79.8k
        {
757
79.8k
            SCOPED_TIMER(local_state.exec_time_counter());
758
79.8k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
79.8k
        }
760
79.8k
    }
761
762
94.0k
    if (!need_more_input_data(state)) {
763
94.0k
        SCOPED_TIMER(local_state.exec_time_counter());
764
94.0k
        bool new_eos = false;
765
94.0k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
94.0k
        if (new_eos) {
767
35.9k
            *eos = true;
768
58.0k
        } else if (!need_more_input_data(state)) {
769
8.81k
            *eos = false;
770
8.81k
        }
771
94.0k
    }
772
94.0k
    return Status::OK();
773
94.0k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
3.88k
                                                         bool* eos) {
745
3.88k
    auto& local_state = get_local_state(state);
746
3.88k
    if (need_more_input_data(state)) {
747
2.13k
        local_state._child_block->clear_column_data(
748
2.13k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.13k
                        .num_materialized_slots());
750
2.13k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.13k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.13k
        *eos = local_state._child_eos;
753
2.13k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
289
            return Status::OK();
755
289
        }
756
1.84k
        {
757
1.84k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.84k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.84k
        }
760
1.84k
    }
761
762
3.60k
    if (!need_more_input_data(state)) {
763
3.60k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.60k
        bool new_eos = false;
765
3.60k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.60k
        if (new_eos) {
767
1.34k
            *eos = true;
768
2.25k
        } else if (!need_more_input_data(state)) {
769
1.73k
            *eos = false;
770
1.73k
        }
771
3.60k
    }
772
3.59k
    return Status::OK();
773
3.59k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.89k
                                                         bool* eos) {
745
1.89k
    auto& local_state = get_local_state(state);
746
1.89k
    if (need_more_input_data(state)) {
747
1.89k
        local_state._child_block->clear_column_data(
748
1.89k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.89k
                        .num_materialized_slots());
750
1.89k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.89k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.89k
        *eos = local_state._child_eos;
753
1.89k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
760
            return Status::OK();
755
760
        }
756
1.13k
        {
757
1.13k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.13k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.13k
        }
760
1.13k
    }
761
762
1.13k
    if (!need_more_input_data(state)) {
763
1.13k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.13k
        bool new_eos = false;
765
1.13k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.13k
        if (new_eos) {
767
779
            *eos = true;
768
779
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.13k
    }
772
1.13k
    return Status::OK();
773
1.13k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
12.9k
                                                         bool* eos) {
745
12.9k
    auto& local_state = get_local_state(state);
746
12.9k
    if (need_more_input_data(state)) {
747
12.9k
        local_state._child_block->clear_column_data(
748
12.9k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
12.9k
                        .num_materialized_slots());
750
12.9k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
12.9k
                state, local_state._child_block.get(), &local_state._child_eos));
752
12.9k
        *eos = local_state._child_eos;
753
12.9k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
2.68k
            return Status::OK();
755
2.68k
        }
756
10.2k
        {
757
10.2k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.2k
        }
760
10.2k
    }
761
762
10.2k
    if (!need_more_input_data(state)) {
763
5.03k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.03k
        bool new_eos = false;
765
5.03k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.03k
        if (new_eos) {
767
4.96k
            *eos = true;
768
4.96k
        } else if (!need_more_input_data(state)) {
769
12
            *eos = false;
770
12
        }
771
5.03k
    }
772
10.2k
    return Status::OK();
773
10.2k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
234k
                                                         bool* eos) {
745
234k
    auto& local_state = get_local_state(state);
746
235k
    if (need_more_input_data(state)) {
747
235k
        local_state._child_block->clear_column_data(
748
235k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
235k
                        .num_materialized_slots());
750
235k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
235k
                state, local_state._child_block.get(), &local_state._child_eos));
752
235k
        *eos = local_state._child_eos;
753
235k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
22.1k
            return Status::OK();
755
22.1k
        }
756
213k
        {
757
213k
            SCOPED_TIMER(local_state.exec_time_counter());
758
213k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
213k
        }
760
213k
    }
761
762
212k
    if (!need_more_input_data(state)) {
763
196k
        SCOPED_TIMER(local_state.exec_time_counter());
764
196k
        bool new_eos = false;
765
196k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
196k
        if (new_eos) {
767
195k
            *eos = true;
768
195k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
196k
    }
772
212k
    return Status::OK();
773
212k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
23.1k
                                                         bool* eos) {
745
23.1k
    auto& local_state = get_local_state(state);
746
23.1k
    if (need_more_input_data(state)) {
747
11.4k
        local_state._child_block->clear_column_data(
748
11.4k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
11.4k
                        .num_materialized_slots());
750
11.4k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
11.4k
                state, local_state._child_block.get(), &local_state._child_eos));
752
11.4k
        *eos = local_state._child_eos;
753
11.4k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.24k
            return Status::OK();
755
1.24k
        }
756
10.2k
        {
757
10.2k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.2k
        }
760
10.2k
    }
761
762
21.9k
    if (!need_more_input_data(state)) {
763
21.3k
        SCOPED_TIMER(local_state.exec_time_counter());
764
21.3k
        bool new_eos = false;
765
21.3k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
21.3k
        if (new_eos) {
767
5.89k
            *eos = true;
768
15.4k
        } else if (!need_more_input_data(state)) {
769
11.7k
            *eos = false;
770
11.7k
        }
771
21.3k
    }
772
21.9k
    return Status::OK();
773
21.9k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.84k
                                                         bool* eos) {
745
7.84k
    auto& local_state = get_local_state(state);
746
7.84k
    if (need_more_input_data(state)) {
747
7.47k
        local_state._child_block->clear_column_data(
748
7.47k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
7.47k
                        .num_materialized_slots());
750
7.47k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
7.47k
                state, local_state._child_block.get(), &local_state._child_eos));
752
7.47k
        *eos = local_state._child_eos;
753
7.47k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
961
            return Status::OK();
755
961
        }
756
6.51k
        {
757
6.51k
            SCOPED_TIMER(local_state.exec_time_counter());
758
6.51k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
6.51k
        }
760
6.51k
    }
761
762
6.87k
    if (!need_more_input_data(state)) {
763
6.87k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.87k
        bool new_eos = false;
765
6.87k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.87k
        if (new_eos) {
767
4.79k
            *eos = true;
768
4.79k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.87k
    }
772
6.87k
    return Status::OK();
773
6.87k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
41.9k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
41.9k
    RETURN_IF_ERROR(Base::init(state, info));
779
41.9k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
41.9k
                                                         "AsyncWriterDependency", true);
781
41.9k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
41.9k
                             _finish_dependency));
783
784
41.9k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
41.9k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
41.9k
    return Status::OK();
787
41.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
357
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
357
    RETURN_IF_ERROR(Base::init(state, info));
779
357
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
357
                                                         "AsyncWriterDependency", true);
781
357
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
357
                             _finish_dependency));
783
784
357
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
357
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
357
    return Status::OK();
787
357
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
41.5k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
41.5k
    RETURN_IF_ERROR(Base::init(state, info));
779
41.5k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
41.5k
                                                         "AsyncWriterDependency", true);
781
41.5k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
41.5k
                             _finish_dependency));
783
784
41.5k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
41.5k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
41.5k
    return Status::OK();
787
41.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
32
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
32
    RETURN_IF_ERROR(Base::init(state, info));
779
32
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
32
                                                         "AsyncWriterDependency", true);
781
32
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
32
                             _finish_dependency));
783
784
32
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
32
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
32
    return Status::OK();
787
32
}
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
42.4k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
42.4k
    RETURN_IF_ERROR(Base::open(state));
793
42.4k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
326k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
283k
        RETURN_IF_ERROR(
796
283k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
283k
    }
798
42.4k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
42.4k
    return Status::OK();
800
42.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
357
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
357
    RETURN_IF_ERROR(Base::open(state));
793
357
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.85k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.49k
        RETURN_IF_ERROR(
796
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.49k
    }
798
357
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
357
    return Status::OK();
800
357
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
42.0k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
42.0k
    RETURN_IF_ERROR(Base::open(state));
793
42.0k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
323k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
281k
        RETURN_IF_ERROR(
796
281k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
281k
    }
798
42.0k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
42.0k
    return Status::OK();
800
42.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
32
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
32
    RETURN_IF_ERROR(Base::open(state));
793
32
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
576
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
544
        RETURN_IF_ERROR(
796
544
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
544
    }
798
32
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
32
    return Status::OK();
800
32
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
57.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
57.0k
    return _writer->sink(block, eos);
806
57.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.45k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.45k
    return _writer->sink(block, eos);
806
1.45k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
55.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
55.5k
    return _writer->sink(block, eos);
806
55.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
32
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
32
    return _writer->sink(block, eos);
806
32
}
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
42.5k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
42.5k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
42.5k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
42.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
42.5k
    if (_writer) {
818
42.5k
        Status st = _writer->get_writer_status();
819
42.5k
        if (exec_status.ok()) {
820
42.4k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
42.4k
                                                       : Status::Cancelled("force close"));
822
42.4k
        } else {
823
102
            _writer->force_close(exec_status);
824
102
        }
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
42.5k
        RETURN_IF_ERROR(st);
829
42.5k
    }
830
42.4k
    return Base::close(state, exec_status);
831
42.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
345
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
345
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
345
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
345
    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
345
    if (_writer) {
818
345
        Status st = _writer->get_writer_status();
819
345
        if (exec_status.ok()) {
820
345
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
345
                                                       : Status::Cancelled("force close"));
822
345
        } 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
345
        RETURN_IF_ERROR(st);
829
345
    }
830
345
    return Base::close(state, exec_status);
831
345
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
42.1k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
42.1k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
42.1k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
42.1k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
42.1k
    if (_writer) {
818
42.1k
        Status st = _writer->get_writer_status();
819
42.1k
        if (exec_status.ok()) {
820
42.0k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
42.0k
                                                       : Status::Cancelled("force close"));
822
42.0k
        } else {
823
102
            _writer->force_close(exec_status);
824
102
        }
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
42.1k
        RETURN_IF_ERROR(st);
829
42.1k
    }
830
42.0k
    return Base::close(state, exec_status);
831
42.1k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
32
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
32
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
32
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
32
    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
32
    if (_writer) {
818
32
        Status st = _writer->get_writer_status();
819
32
        if (exec_status.ok()) {
820
32
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
32
                                                       : Status::Cancelled("force close"));
822
32
        } 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
32
        RETURN_IF_ERROR(st);
829
32
    }
830
32
    return Base::close(state, exec_status);
831
32
}
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