Coverage Report

Created: 2026-09-04 14:18

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.55M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.55M
    if (_parent->nereids_id() == -1) {
122
789k
        return fmt::format("(id={})", _parent->node_id());
123
789k
    } else {
124
761k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
761k
    }
126
1.55M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
64.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
64.9k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
64.9k
    } else {
124
64.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
64.9k
    }
126
64.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
176k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
176k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
176k
    } else {
124
176k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
176k
    }
126
176k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
37
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
37
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
37
    } else {
124
37
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
37
    }
126
37
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.88k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.88k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.88k
    } else {
124
5.88k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.88k
    }
126
5.88k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.11k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.11k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
8.10k
    } else {
124
8.10k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.10k
    }
126
8.11k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
84.5k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
84.5k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
84.5k
    } else {
124
84.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
84.5k
    }
126
84.5k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
85.7k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
85.7k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
85.7k
    } else {
124
85.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
85.7k
    }
126
85.7k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
64
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
64
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
64
    } else {
124
64
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
64
    }
126
64
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
525k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
525k
    if (_parent->nereids_id() == -1) {
122
248k
        return fmt::format("(id={})", _parent->node_id());
123
276k
    } else {
124
276k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
276k
    }
126
525k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
53.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
53.0k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
53.0k
    } else {
124
53.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
53.0k
    }
126
53.0k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.26k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.27k
    if (_parent->nereids_id() == -1) {
122
4.27k
        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.26k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
394
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
394
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
292
    } else {
124
292
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
292
    }
126
394
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.22k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.22k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.20k
    } else {
124
5.20k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.20k
    }
126
5.22k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
536k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
536k
    if (_parent->nereids_id() == -1) {
122
536k
        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
536k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
164
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
164
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
164
    } else {
124
164
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
164
    }
126
164
}
127
128
template <typename SharedStateArg>
129
1.09M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.09M
    if (_parent->nereids_id() == -1) {
131
613k
        return fmt::format("(id={})", _parent->node_id());
132
613k
    } else {
133
482k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
482k
    }
135
1.09M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
113k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
113k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
113k
    } else {
133
113k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
113k
    }
135
113k
}
_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
177k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
177k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
177k
    } else {
133
177k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
177k
    }
135
177k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
44
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
44
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
44
    } else {
133
44
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
44
    }
135
44
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.86k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.86k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.86k
    } else {
133
5.86k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.86k
    }
135
5.86k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.13k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.13k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
8.12k
    } else {
133
8.12k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.12k
    }
135
8.13k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
84.7k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
84.7k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
84.7k
    } else {
133
84.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
84.7k
    }
135
84.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
85.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
85.5k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
85.5k
    } else {
133
85.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
85.5k
    }
135
85.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
74
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
74
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
74
    } else {
133
74
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
74
    }
135
74
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
12
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
12
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.92k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.92k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
7.92k
    } else {
133
7.92k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.92k
    }
135
7.92k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
394
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
394
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
292
    } else {
133
292
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
292
    }
135
394
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.8k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.8k
    if (_parent->nereids_id() == -1) {
131
12.8k
        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.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
198k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
198k
    if (_parent->nereids_id() == -1) {
131
198k
        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
198k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
401k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
401k
    if (_parent->nereids_id() == -1) {
131
401k
        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
401k
}
_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
29.4k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.4k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
29.4k
    _terminated = true;
143
29.4k
    return Status::OK();
144
29.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.75k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.75k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.75k
    _terminated = true;
143
1.75k
    return Status::OK();
144
1.75k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.72k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.72k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.72k
    _terminated = true;
143
1.72k
    return Status::OK();
144
1.72k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
766
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
766
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
766
    _terminated = true;
143
766
    return Status::OK();
144
766
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
279
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
279
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
279
    _terminated = true;
143
279
    return Status::OK();
144
279
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
319
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
319
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
319
    _terminated = true;
143
319
    return Status::OK();
144
319
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
220
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
220
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
220
    _terminated = true;
143
220
    return Status::OK();
144
220
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
19
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
19
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
19
    _terminated = true;
143
19
    return Status::OK();
144
19
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
213
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
213
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
213
    _terminated = true;
143
213
    return Status::OK();
144
213
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
124
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
124
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
124
    _terminated = true;
143
124
    return Status::OK();
144
124
}
145
146
285k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
285k
    return _child && _child->is_serial_operator() && !is_source()
148
285k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
285k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
285k
}
151
152
22.4k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
22.4k
    if (!_child) {
154
21.4k
        return false;
155
21.4k
    }
156
1.00k
    if (_child->is_serial_operator()) {
157
109
        return true;
158
109
    }
159
897
    const auto child_distribution = _child->required_data_distribution(state);
160
897
    return child_distribution.need_local_exchange() &&
161
897
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.00k
}
163
164
template <typename SharedStateArg>
165
18.9k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
18.9k
    fmt::memory_buffer debug_string_buffer;
167
18.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
18.9k
    return fmt::to_string(debug_string_buffer);
169
18.9k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
18.9k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
18.9k
    fmt::memory_buffer debug_string_buffer;
167
18.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
18.9k
    return fmt::to_string(debug_string_buffer);
169
18.9k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
18.9k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
18.9k
    fmt::memory_buffer debug_string_buffer;
174
18.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
18.9k
    return fmt::to_string(debug_string_buffer);
176
18.9k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
18.9k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
18.9k
    fmt::memory_buffer debug_string_buffer;
174
18.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
18.9k
    return fmt::to_string(debug_string_buffer);
176
18.9k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
18.9k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
18.9k
    fmt::memory_buffer debug_string_buffer;
180
18.9k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
18.9k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
18.9k
                   _is_serial_operator);
183
18.9k
    return fmt::to_string(debug_string_buffer);
184
18.9k
}
185
186
18.9k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
18.9k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
18.9k
}
189
190
609k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
609k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
609k
    _nereids_id = tnode.nereids_id;
193
609k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.59k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.59k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.59k
            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.59k
    }
206
609k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
609k
    _op_name = substr + "_OPERATOR";
208
209
609k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
609k
    } else if (tnode.__isset.conjuncts) {
212
262k
        for (const auto& conjunct : tnode.conjuncts) {
213
262k
            VExprContextSPtr context;
214
262k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
262k
            _conjuncts.emplace_back(context);
216
262k
        }
217
92.0k
    }
218
219
    // create the projections expr
220
609k
    if (tnode.__isset.projections) {
221
245k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
245k
    }
223
609k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.59k
        DCHECK(has_projection()) << "no final projections";
225
3.59k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
5.76k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
5.76k
            VExprContextSPtrs projections;
228
5.76k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
5.76k
            _projection->intermediate_projections.push_back(projections);
230
5.76k
        }
231
3.59k
    }
232
609k
    return Status::OK();
233
609k
}
234
235
636k
Status OperatorXBase::prepare(RuntimeState* state) {
236
636k
    for (auto& conjunct : _conjuncts) {
237
262k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
262k
    }
239
636k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
586k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
334k
            return a->execute_cost() < b->execute_cost();
242
334k
        });
243
586k
    };
244
245
636k
    if (has_projection()) {
246
244k
        auto& projection = *_projection;
247
250k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
5.76k
            const auto& input_row_desc =
249
5.76k
                    i == 0 ? operator_row_desc_before_projection()
250
5.76k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
5.76k
            RETURN_IF_ERROR(
252
5.76k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
5.76k
        }
254
244k
        const auto& final_projection_input_row_desc =
255
244k
                projection.intermediate_output_row_descriptors.empty()
256
244k
                        ? operator_row_desc_before_projection()
257
244k
                        : projection.intermediate_output_row_descriptors.back();
258
244k
        RETURN_IF_ERROR(
259
244k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
244k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
244k
                                                      projection.output_row_descriptor));
262
244k
    }
263
264
636k
    for (auto& conjunct : _conjuncts) {
265
262k
        RETURN_IF_ERROR(conjunct->open(state));
266
262k
    }
267
636k
    if (has_projection()) {
268
244k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
244k
        for (auto& projections : _projection->intermediate_projections) {
270
5.76k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
5.76k
        }
272
244k
    }
273
636k
    if (_child && !is_source()) {
274
90.3k
        RETURN_IF_ERROR(_child->prepare(state));
275
90.3k
    }
276
277
636k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
636k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
636k
    return Status::OK();
283
636k
}
284
285
6.11k
Status OperatorXBase::terminate(RuntimeState* state) {
286
6.11k
    if (_child && !is_source()) {
287
648
        RETURN_IF_ERROR(_child->terminate(state));
288
648
    }
289
6.11k
    auto result = state->get_local_state_result(operator_id());
290
6.11k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
6.11k
    return result.value()->terminate(state);
294
6.11k
}
295
296
4.24M
Status OperatorXBase::close(RuntimeState* state) {
297
4.24M
    if (_child && !is_source()) {
298
683k
        RETURN_IF_ERROR(_child->close(state));
299
683k
    }
300
4.24M
    auto result = state->get_local_state_result(operator_id());
301
4.24M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.24M
    return result.value()->close(state);
305
4.24M
}
306
307
258k
void PipelineXLocalStateBase::clear_origin_block() {
308
258k
    _origin_block.clear_column_data(
309
258k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
258k
}
311
312
773k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
773k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
773k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
773k
    return Status::OK();
317
773k
}
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
258k
                                     Block* output_block) const {
326
258k
    auto* local_state = state->get_local_state(operator_id());
327
258k
    SCOPED_TIMER(local_state->exec_time_counter());
328
258k
    SCOPED_TIMER(local_state->_projection_timer);
329
258k
    const size_t rows = origin_block->rows();
330
258k
    if (rows == 0) {
331
137k
        return Status::OK();
332
137k
    }
333
121k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
121k
    {
336
121k
        Block input_block = *origin_block;
337
338
121k
        ColumnsWithTypeAndName new_columns;
339
121k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.38k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.38k
            new_columns.resize(projections.size());
345
64.6k
            for (int i = 0; i < projections.size(); i++) {
346
61.2k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
61.2k
                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
61.2k
            }
355
3.38k
            Block tmp_block {new_columns};
356
3.38k
            input_block.swap(tmp_block);
357
3.38k
        }
358
359
121k
        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
121k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
121k
                output_block, _projection->output_row_descriptor);
368
121k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
121k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
121k
        Columns shared_columns(mutable_columns.size());
371
372
707k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
585k
            ColumnPtr column_ptr;
374
585k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
585k
            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
585k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
585k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
585k
            if (column_ptr->is_exclusive()) {
386
221k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
364k
            } else {
388
364k
                shared_columns[i] = std::move(column_ptr);
389
364k
            }
390
585k
        }
391
392
121k
        scoped_mutable_block.restore();
393
707k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
585k
            if (shared_columns[i]) {
395
364k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
364k
            }
397
585k
        }
398
121k
    }
399
400
0
    origin_block->clear_column_data(
401
121k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
121k
    DCHECK_EQ(output_block->rows(), rows);
403
404
121k
    return Status::OK();
405
121k
}
406
407
4.17M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.17M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.17M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.17M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.17M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.17M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.17M
            if (_debug_point_count++ % 2 == 0) {
414
4.17M
                return Status::OK();
415
4.17M
            }
416
4.17M
        }
417
4.17M
    });
418
419
4.17M
    Status status;
420
4.17M
    auto* local_state = state->get_local_state(operator_id());
421
4.17M
    Defer defer([&]() {
422
4.17M
        if (status.ok()) {
423
4.17M
            local_state->update_output_block_counters(*block);
424
4.17M
        }
425
4.17M
    });
426
4.17M
    if (has_projection()) {
427
258k
        local_state->clear_origin_block();
428
258k
        status = get_block(state, &local_state->_origin_block, eos);
429
258k
        if (UNLIKELY(!status.ok())) {
430
24
            return status;
431
24
        }
432
258k
        status = do_projections(state, &local_state->_origin_block, block);
433
258k
        return status;
434
258k
    }
435
3.91M
    status = get_block(state, block, eos);
436
3.91M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.91M
    return status;
438
3.91M
}
439
440
2.59M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.59M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
4.25k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
4.25k
        *eos = true;
444
4.25k
    }
445
446
2.59M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.59M
        auto op_name = to_lower(_parent->_op_name);
448
2.59M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.59M
        arg_op_name = to_lower(arg_op_name);
450
451
2.59M
        if (op_name == arg_op_name) {
452
2.59M
            *eos = true;
453
2.59M
        }
454
2.59M
    });
455
456
2.59M
    if (auto rows = block->rows()) {
457
696k
        _num_rows_returned += rows;
458
696k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
696k
    }
460
2.59M
}
461
462
29.4k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
29.4k
    auto result = state->get_sink_local_state_result();
464
29.4k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
29.4k
    return result.value()->terminate(state);
468
29.4k
}
469
470
18.9k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
18.9k
    fmt::memory_buffer debug_string_buffer;
472
473
18.9k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
18.9k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
18.9k
    return fmt::to_string(debug_string_buffer);
476
18.9k
}
477
478
18.9k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
18.9k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
18.9k
}
481
482
319k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
319k
    std::string op_name = "UNKNOWN_SINK";
484
319k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
320k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
320k
        op_name = it->second;
488
320k
    }
489
319k
    _name = op_name + "_OPERATOR";
490
319k
    return Status::OK();
491
319k
}
492
493
272k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
272k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
272k
    _nereids_id = tnode.nereids_id;
496
272k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
272k
    _name = substr + "_SINK_OPERATOR";
498
272k
    return Status::OK();
499
272k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.53M
                                                            LocalSinkStateInfo& info) {
504
1.53M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.53M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.53M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.53M
    return Status::OK();
508
1.53M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
113k
                                                            LocalSinkStateInfo& info) {
504
113k
    auto local_state = LocalStateType::create_unique(this, state);
505
113k
    RETURN_IF_ERROR(local_state->init(state, info));
506
113k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
113k
    return Status::OK();
508
113k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
356k
                                                            LocalSinkStateInfo& info) {
504
356k
    auto local_state = LocalStateType::create_unique(this, state);
505
356k
    RETURN_IF_ERROR(local_state->init(state, info));
506
356k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
356k
    return Status::OK();
508
356k
}
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
354
                                                            LocalSinkStateInfo& info) {
504
354
    auto local_state = LocalStateType::create_unique(this, state);
505
354
    RETURN_IF_ERROR(local_state->init(state, info));
506
354
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
354
    return Status::OK();
508
354
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
45.7k
                                                            LocalSinkStateInfo& info) {
504
45.7k
    auto local_state = LocalStateType::create_unique(this, state);
505
45.7k
    RETURN_IF_ERROR(local_state->init(state, info));
506
45.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
45.7k
    return Status::OK();
508
45.7k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8
                                                            LocalSinkStateInfo& info) {
504
8
    auto local_state = LocalStateType::create_unique(this, state);
505
8
    RETURN_IF_ERROR(local_state->init(state, info));
506
8
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8
    return Status::OK();
508
8
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.13k
                                                            LocalSinkStateInfo& info) {
504
8.13k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.13k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.13k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.13k
    return Status::OK();
508
8.13k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
9
                                                            LocalSinkStateInfo& info) {
504
9
    auto local_state = LocalStateType::create_unique(this, state);
505
9
    RETURN_IF_ERROR(local_state->init(state, info));
506
9
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
9
    return Status::OK();
508
9
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
177k
                                                            LocalSinkStateInfo& info) {
504
177k
    auto local_state = LocalStateType::create_unique(this, state);
505
177k
    RETURN_IF_ERROR(local_state->init(state, info));
506
177k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
177k
    return Status::OK();
508
177k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
44
                                                            LocalSinkStateInfo& info) {
504
44
    auto local_state = LocalStateType::create_unique(this, state);
505
44
    RETURN_IF_ERROR(local_state->init(state, info));
506
44
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
44
    return Status::OK();
508
44
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
198k
                                                            LocalSinkStateInfo& info) {
504
198k
    auto local_state = LocalStateType::create_unique(this, state);
505
198k
    RETURN_IF_ERROR(local_state->init(state, info));
506
198k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
198k
    return Status::OK();
508
198k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
84.8k
                                                            LocalSinkStateInfo& info) {
504
84.8k
    auto local_state = LocalStateType::create_unique(this, state);
505
84.8k
    RETURN_IF_ERROR(local_state->init(state, info));
506
84.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
84.8k
    return Status::OK();
508
84.8k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
85.3k
                                                            LocalSinkStateInfo& info) {
504
85.3k
    auto local_state = LocalStateType::create_unique(this, state);
505
85.3k
    RETURN_IF_ERROR(local_state->init(state, info));
506
85.3k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
85.3k
    return Status::OK();
508
85.3k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
74
                                                            LocalSinkStateInfo& info) {
504
74
    auto local_state = LocalStateType::create_unique(this, state);
505
74
    RETURN_IF_ERROR(local_state->init(state, info));
506
74
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
74
    return Status::OK();
508
74
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
431k
                                                            LocalSinkStateInfo& info) {
504
431k
    auto local_state = LocalStateType::create_unique(this, state);
505
431k
    RETURN_IF_ERROR(local_state->init(state, info));
506
431k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
431k
    return Status::OK();
508
431k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.86k
                                                            LocalSinkStateInfo& info) {
504
5.86k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.86k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.86k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.86k
    return Status::OK();
508
5.86k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7.93k
                                                            LocalSinkStateInfo& info) {
504
7.93k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.93k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.93k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.93k
    return Status::OK();
508
7.93k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1.60k
                                                            LocalSinkStateInfo& info) {
504
1.60k
    auto local_state = LocalStateType::create_unique(this, state);
505
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.60k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.60k
    return Status::OK();
508
1.60k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
293
                                                            LocalSinkStateInfo& info) {
504
293
    auto local_state = LocalStateType::create_unique(this, state);
505
293
    RETURN_IF_ERROR(local_state->init(state, info));
506
293
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
293
    return Status::OK();
508
293
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.91k
                                                            LocalSinkStateInfo& info) {
504
4.91k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.91k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.91k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.91k
    return Status::OK();
508
4.91k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.71k
                                                            LocalSinkStateInfo& info) {
504
2.71k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.71k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.71k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.71k
    return Status::OK();
508
2.71k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.62k
                                                            LocalSinkStateInfo& info) {
504
2.62k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.62k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.62k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.62k
    return Status::OK();
508
2.62k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.54k
                                                            LocalSinkStateInfo& info) {
504
2.54k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.54k
    return Status::OK();
508
2.54k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
565
                                                            LocalSinkStateInfo& info) {
504
565
    auto local_state = LocalStateType::create_unique(this, state);
505
565
    RETURN_IF_ERROR(local_state->init(state, info));
506
565
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
565
    return Status::OK();
508
565
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
101
                                                            LocalSinkStateInfo& info) {
504
101
    auto local_state = LocalStateType::create_unique(this, state);
505
101
    RETURN_IF_ERROR(local_state->init(state, info));
506
101
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
101
    return Status::OK();
508
101
}
_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.21M
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.21M
    } else {
519
1.21M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.21M
        ss->id = operator_id();
521
1.21M
        for (auto& dest : dests_id()) {
522
1.21M
            ss->related_op_ids.insert(dest);
523
1.21M
        }
524
1.21M
        return ss;
525
1.21M
    }
526
1.21M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
98.7k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
98.7k
    } else {
519
98.7k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
98.7k
        ss->id = operator_id();
521
98.7k
        for (auto& dest : dests_id()) {
522
98.5k
            ss->related_op_ids.insert(dest);
523
98.5k
        }
524
98.7k
        return ss;
525
98.7k
    }
526
98.7k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
356k
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
356k
    } else {
519
356k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
356k
        ss->id = operator_id();
521
356k
        for (auto& dest : dests_id()) {
522
354k
            ss->related_op_ids.insert(dest);
523
354k
        }
524
356k
        return ss;
525
356k
    }
526
356k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
3
    } else {
519
3
        auto ss = LocalStateType::SharedStateType::create_shared();
520
3
        ss->id = operator_id();
521
3
        for (auto& dest : dests_id()) {
522
3
            ss->related_op_ids.insert(dest);
523
3
        }
524
3
        return ss;
525
3
    }
526
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
355
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
355
    } else {
519
355
        auto ss = LocalStateType::SharedStateType::create_shared();
520
355
        ss->id = operator_id();
521
355
        for (auto& dest : dests_id()) {
522
355
            ss->related_op_ids.insert(dest);
523
355
        }
524
355
        return ss;
525
355
    }
526
355
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
45.7k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
45.7k
    } else {
519
45.7k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
45.7k
        ss->id = operator_id();
521
45.7k
        for (auto& dest : dests_id()) {
522
45.3k
            ss->related_op_ids.insert(dest);
523
45.3k
        }
524
45.7k
        return ss;
525
45.7k
    }
526
45.7k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
8
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8
    } else {
519
8
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8
        ss->id = operator_id();
521
8
        for (auto& dest : dests_id()) {
522
8
            ss->related_op_ids.insert(dest);
523
8
        }
524
8
        return ss;
525
8
    }
526
8
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
8.15k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8.15k
    } else {
519
8.15k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.15k
        ss->id = operator_id();
521
8.15k
        for (auto& dest : dests_id()) {
522
8.15k
            ss->related_op_ids.insert(dest);
523
8.15k
        }
524
8.15k
        return ss;
525
8.15k
    }
526
8.15k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
9
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
9
    } else {
519
9
        auto ss = LocalStateType::SharedStateType::create_shared();
520
9
        ss->id = operator_id();
521
9
        for (auto& dest : dests_id()) {
522
9
            ss->related_op_ids.insert(dest);
523
9
        }
524
9
        return ss;
525
9
    }
526
9
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
177k
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
177k
    } else {
519
177k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
177k
        ss->id = operator_id();
521
177k
        for (auto& dest : dests_id()) {
522
177k
            ss->related_op_ids.insert(dest);
523
177k
        }
524
177k
        return ss;
525
177k
    }
526
177k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46
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
46
    } else {
519
46
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46
        ss->id = operator_id();
521
46
        for (auto& dest : dests_id()) {
522
46
            ss->related_op_ids.insert(dest);
523
46
        }
524
46
        return ss;
525
46
    }
526
46
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
84.9k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
84.9k
    } else {
519
84.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
84.9k
        ss->id = operator_id();
521
85.1k
        for (auto& dest : dests_id()) {
522
85.1k
            ss->related_op_ids.insert(dest);
523
85.1k
        }
524
84.9k
        return ss;
525
84.9k
    }
526
84.9k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
73
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
73
    } else {
519
73
        auto ss = LocalStateType::SharedStateType::create_shared();
520
73
        ss->id = operator_id();
521
73
        for (auto& dest : dests_id()) {
522
73
            ss->related_op_ids.insert(dest);
523
73
        }
524
73
        return ss;
525
73
    }
526
73
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
432k
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
432k
    } else {
519
432k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
432k
        ss->id = operator_id();
521
432k
        for (auto& dest : dests_id()) {
522
432k
            ss->related_op_ids.insert(dest);
523
432k
        }
524
432k
        return ss;
525
432k
    }
526
432k
}
_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.89k
        for (auto& dest : dests_id()) {
522
5.89k
            ss->related_op_ids.insert(dest);
523
5.89k
        }
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
394
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
394
    } else {
519
394
        auto ss = LocalStateType::SharedStateType::create_shared();
520
394
        ss->id = operator_id();
521
395
        for (auto& dest : dests_id()) {
522
395
            ss->related_op_ids.insert(dest);
523
395
        }
524
394
        return ss;
525
394
    }
526
394
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.60k
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.60k
    } else {
519
2.60k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.60k
        ss->id = operator_id();
521
2.62k
        for (auto& dest : dests_id()) {
522
2.62k
            ss->related_op_ids.insert(dest);
523
2.62k
        }
524
2.60k
        return ss;
525
2.60k
    }
526
2.60k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.53k
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.53k
    } else {
519
2.53k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.53k
        ss->id = operator_id();
521
2.54k
        for (auto& dest : dests_id()) {
522
2.54k
            ss->related_op_ids.insert(dest);
523
2.54k
        }
524
2.53k
        return ss;
525
2.53k
    }
526
2.53k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
568
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
568
    } else {
519
568
        auto ss = LocalStateType::SharedStateType::create_shared();
520
568
        ss->id = operator_id();
521
568
        for (auto& dest : dests_id()) {
522
564
            ss->related_op_ids.insert(dest);
523
564
        }
524
568
        return ss;
525
568
    }
526
568
}
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
102
            ss->related_op_ids.insert(dest);
523
102
        }
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.80M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.80M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.80M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.80M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.80M
    return Status::OK();
534
1.80M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
65.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
65.4k
    auto local_state = LocalStateType::create_unique(state, this);
531
65.4k
    RETURN_IF_ERROR(local_state->init(state, info));
532
65.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
65.4k
    return Status::OK();
534
65.4k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
241k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
241k
    auto local_state = LocalStateType::create_unique(state, this);
531
241k
    RETURN_IF_ERROR(local_state->init(state, info));
532
241k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
241k
    return Status::OK();
534
241k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
140
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
140
    auto local_state = LocalStateType::create_unique(state, this);
531
140
    RETURN_IF_ERROR(local_state->init(state, info));
532
140
    state->emplace_local_state(operator_id(), std::move(local_state));
533
140
    return Status::OK();
534
140
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.11k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.11k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.11k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.11k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.11k
    return Status::OK();
534
8.11k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.03k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.03k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.03k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.03k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.03k
    return Status::OK();
534
8.03k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
37
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
37
    auto local_state = LocalStateType::create_unique(state, this);
531
37
    RETURN_IF_ERROR(local_state->init(state, info));
532
37
    state->emplace_local_state(operator_id(), std::move(local_state));
533
37
    return Status::OK();
534
37
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
169k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
169k
    auto local_state = LocalStateType::create_unique(state, this);
531
169k
    RETURN_IF_ERROR(local_state->init(state, info));
532
169k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
169k
    return Status::OK();
534
169k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
84.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
84.7k
    auto local_state = LocalStateType::create_unique(state, this);
531
84.7k
    RETURN_IF_ERROR(local_state->init(state, info));
532
84.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
84.7k
    return Status::OK();
534
84.7k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
85.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
85.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
85.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
85.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
85.8k
    return Status::OK();
534
85.8k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
64
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
64
    auto local_state = LocalStateType::create_unique(state, this);
531
64
    RETURN_IF_ERROR(local_state->init(state, info));
532
64
    state->emplace_local_state(operator_id(), std::move(local_state));
533
64
    return Status::OK();
534
64
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.30k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.30k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.30k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.30k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.30k
    return Status::OK();
534
4.30k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
248k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
248k
    auto local_state = LocalStateType::create_unique(state, this);
531
248k
    RETURN_IF_ERROR(local_state->init(state, info));
532
248k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
248k
    return Status::OK();
534
248k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.33k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.33k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.33k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.33k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.33k
    return Status::OK();
534
1.33k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.88k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.88k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.88k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.88k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.88k
    return Status::OK();
534
5.88k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
27
    auto local_state = LocalStateType::create_unique(state, this);
531
27
    RETURN_IF_ERROR(local_state->init(state, info));
532
27
    state->emplace_local_state(operator_id(), std::move(local_state));
533
27
    return Status::OK();
534
27
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
53.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
53.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
53.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
53.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
53.1k
    return Status::OK();
534
53.1k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.28k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.28k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.28k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.28k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.28k
    return Status::OK();
534
4.28k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
292
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
292
    auto local_state = LocalStateType::create_unique(state, this);
531
292
    RETURN_IF_ERROR(local_state->init(state, info));
532
292
    state->emplace_local_state(operator_id(), std::move(local_state));
533
292
    return Status::OK();
534
292
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.64k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.64k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.64k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.64k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.64k
    return Status::OK();
534
2.64k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.55k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.55k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.55k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.55k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.55k
    return Status::OK();
534
2.55k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
291
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
291
    auto local_state = LocalStateType::create_unique(state, this);
531
291
    RETURN_IF_ERROR(local_state->init(state, info));
532
291
    state->emplace_local_state(operator_id(), std::move(local_state));
533
291
    return Status::OK();
534
291
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.11k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.11k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.11k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.11k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.11k
    return Status::OK();
534
5.11k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
540k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
540k
    auto local_state = LocalStateType::create_unique(state, this);
531
540k
    RETURN_IF_ERROR(local_state->init(state, info));
532
540k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
540k
    return Status::OK();
534
540k
}
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
784
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
784
    auto local_state = LocalStateType::create_unique(state, this);
531
784
    RETURN_IF_ERROR(local_state->init(state, info));
532
784
    state->emplace_local_state(operator_id(), std::move(local_state));
533
784
    return Status::OK();
534
784
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
808
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
808
    auto local_state = LocalStateType::create_unique(state, this);
531
808
    RETURN_IF_ERROR(local_state->init(state, info));
532
808
    state->emplace_local_state(operator_id(), std::move(local_state));
533
808
    return Status::OK();
534
808
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.93k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.93k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.93k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.93k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.93k
    return Status::OK();
534
5.93k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
254k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
254k
    auto local_state = LocalStateType::create_unique(state, this);
531
254k
    RETURN_IF_ERROR(local_state->init(state, info));
532
254k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
254k
    return Status::OK();
534
254k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.52M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.79M
        : _num_rows_returned(0),
542
1.79M
          _rows_returned_counter(nullptr),
543
1.79M
          _parent(parent),
544
1.79M
          _state(state),
545
1.79M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.80M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.80M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.80M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.80M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.80M
    _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.80M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.80M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.80M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.80M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.80M
    if constexpr (!is_fake_shared) {
560
1.03M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
639k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
639k
                                    .first.get()
563
639k
                                    ->template cast<SharedStateArg>();
564
565
639k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
639k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
639k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
639k
        } else if (info.shared_state) {
569
336k
            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
336k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
336k
            _dependency = _shared_state->create_source_dependency(
576
336k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
336k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
336k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
336k
        } else {
580
58.3k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
3.69k
                DCHECK(false);
582
3.69k
            }
583
58.3k
        }
584
1.03M
    }
585
586
1.80M
    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.80M
    _rows_returned_counter =
591
1.80M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.80M
    _blocks_returned_counter =
593
1.80M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.80M
    _output_block_bytes_counter =
595
1.80M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.80M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.80M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.80M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.80M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.80M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.80M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.80M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.80M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.80M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.80M
    _memory_used_counter =
606
1.80M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.80M
    _common_profile->add_info_string("IsColocate",
608
1.80M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.80M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.80M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.80M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.80M
    return Status::OK();
613
1.80M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
65.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
65.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
65.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
65.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
65.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
65.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
65.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
65.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
65.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
65.5k
    if constexpr (!is_fake_shared) {
560
65.5k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
14.6k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
14.6k
                                    .first.get()
563
14.6k
                                    ->template cast<SharedStateArg>();
564
565
14.6k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
14.6k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
14.6k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
50.9k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
50.3k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
50.3k
            _dependency = _shared_state->create_source_dependency(
576
50.3k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
50.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
50.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.3k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
595
        }
584
65.5k
    }
585
586
65.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
65.5k
    _rows_returned_counter =
591
65.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
65.5k
    _blocks_returned_counter =
593
65.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
65.5k
    _output_block_bytes_counter =
595
65.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
65.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
65.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
65.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
65.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
65.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
65.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
65.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
65.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
65.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
65.5k
    _memory_used_counter =
606
65.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
65.5k
    _common_profile->add_info_string("IsColocate",
608
65.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
65.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
65.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
65.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
65.5k
    return Status::OK();
613
65.5k
}
_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
177k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
177k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
177k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
177k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
177k
    _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
177k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
177k
    _operator_profile->add_child(_common_profile.get(), true);
557
177k
    _operator_profile->add_child(_custom_profile.get(), true);
558
177k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
177k
    if constexpr (!is_fake_shared) {
560
177k
        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
177k
        } 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
174k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
174k
            _dependency = _shared_state->create_source_dependency(
576
174k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
174k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
174k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
174k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
3.35k
        }
584
177k
    }
585
586
177k
    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
177k
    _rows_returned_counter =
591
177k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
177k
    _blocks_returned_counter =
593
177k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
177k
    _output_block_bytes_counter =
595
177k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
177k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
177k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
177k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
177k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
177k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
177k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
177k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
177k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
177k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
177k
    _memory_used_counter =
606
177k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
177k
    _common_profile->add_info_string("IsColocate",
608
177k
                                     std::to_string(_parent->is_colocated_operator()));
609
177k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
177k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
177k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
177k
    return Status::OK();
613
177k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
37
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
37
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
37
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
37
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
37
    _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
37
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
37
    _operator_profile->add_child(_common_profile.get(), true);
557
37
    _operator_profile->add_child(_custom_profile.get(), true);
558
37
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
37
    if constexpr (!is_fake_shared) {
560
37
        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
37
        } 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
37
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
37
            _dependency = _shared_state->create_source_dependency(
576
37
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
37
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
37
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
37
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
37
    }
585
586
37
    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
37
    _rows_returned_counter =
591
37
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
37
    _blocks_returned_counter =
593
37
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
37
    _output_block_bytes_counter =
595
37
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
37
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
37
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
37
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
37
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
37
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
37
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
37
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
37
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
37
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
37
    _memory_used_counter =
606
37
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
37
    _common_profile->add_info_string("IsColocate",
608
37
                                     std::to_string(_parent->is_colocated_operator()));
609
37
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
37
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
37
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
37
    return Status::OK();
613
37
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.89k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.89k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.89k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.89k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.89k
    _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.89k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.89k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.89k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.89k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.89k
    if constexpr (!is_fake_shared) {
560
5.89k
        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.89k
        } 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.88k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.88k
            _dependency = _shared_state->create_source_dependency(
576
5.88k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.88k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.88k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.88k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
12
        }
584
5.89k
    }
585
586
5.89k
    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.89k
    _rows_returned_counter =
591
5.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.89k
    _blocks_returned_counter =
593
5.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.89k
    _output_block_bytes_counter =
595
5.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.89k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.89k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.89k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.89k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.89k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.89k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.89k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.89k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.89k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.89k
    _memory_used_counter =
606
5.89k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.89k
    _common_profile->add_info_string("IsColocate",
608
5.89k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.89k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.89k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.89k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.89k
    return Status::OK();
613
5.89k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.15k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.15k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.15k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.15k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.15k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
8.15k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.15k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.15k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.15k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.15k
    if constexpr (!is_fake_shared) {
560
8.15k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
8.15k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
8.08k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.08k
            _dependency = _shared_state->create_source_dependency(
576
8.08k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.08k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.08k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.08k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
66
        }
584
8.15k
    }
585
586
8.15k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
8.15k
    _rows_returned_counter =
591
8.15k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.15k
    _blocks_returned_counter =
593
8.15k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.15k
    _output_block_bytes_counter =
595
8.15k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.15k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.15k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.15k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.15k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.15k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.15k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.15k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.15k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.15k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.15k
    _memory_used_counter =
606
8.15k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.15k
    _common_profile->add_info_string("IsColocate",
608
8.15k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.15k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.15k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.15k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.15k
    return Status::OK();
613
8.15k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
84.9k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
84.9k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
84.9k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
84.9k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
84.9k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
84.9k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
84.9k
    _operator_profile->add_child(_common_profile.get(), true);
557
84.9k
    _operator_profile->add_child(_custom_profile.get(), true);
558
84.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
84.9k
    if constexpr (!is_fake_shared) {
560
84.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
84.9k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
83.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
83.8k
            _dependency = _shared_state->create_source_dependency(
576
83.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
83.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
83.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
83.8k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.17k
        }
584
84.9k
    }
585
586
84.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
84.9k
    _rows_returned_counter =
591
84.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
84.9k
    _blocks_returned_counter =
593
84.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
84.9k
    _output_block_bytes_counter =
595
84.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
84.9k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
84.9k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
84.9k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
84.9k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
84.9k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
84.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
84.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
84.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
84.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
84.9k
    _memory_used_counter =
606
84.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
84.9k
    _common_profile->add_info_string("IsColocate",
608
84.9k
                                     std::to_string(_parent->is_colocated_operator()));
609
84.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
84.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
84.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
84.9k
    return Status::OK();
613
84.9k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
85.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
85.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
85.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
85.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
85.8k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
85.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
85.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
85.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
85.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
85.8k
    if constexpr (!is_fake_shared) {
560
85.8k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
85.8k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
85.8k
                                    .first.get()
563
85.8k
                                    ->template cast<SharedStateArg>();
564
565
85.8k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
85.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
85.8k
                    _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
85.8k
    }
585
586
85.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
85.8k
    _rows_returned_counter =
591
85.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
85.8k
    _blocks_returned_counter =
593
85.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
85.8k
    _output_block_bytes_counter =
595
85.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
85.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
85.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
85.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
85.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
85.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
85.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
85.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
85.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
85.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
85.8k
    _memory_used_counter =
606
85.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
85.8k
    _common_profile->add_info_string("IsColocate",
608
85.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
85.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
85.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
85.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
85.8k
    return Status::OK();
613
85.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
64
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
64
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
64
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
64
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
64
    _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
64
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
64
    _operator_profile->add_child(_common_profile.get(), true);
557
64
    _operator_profile->add_child(_custom_profile.get(), true);
558
64
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
64
    if constexpr (!is_fake_shared) {
560
64
        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
64
        } 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
64
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
64
            _dependency = _shared_state->create_source_dependency(
576
64
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
64
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
64
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
64
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
64
    }
585
586
64
    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
64
    _rows_returned_counter =
591
64
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
64
    _blocks_returned_counter =
593
64
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
64
    _output_block_bytes_counter =
595
64
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
64
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
64
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
64
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
64
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
64
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
64
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
64
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
64
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
64
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
64
    _memory_used_counter =
606
64
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
64
    _common_profile->add_info_string("IsColocate",
608
64
                                     std::to_string(_parent->is_colocated_operator()));
609
64
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
64
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
64
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
64
    return Status::OK();
613
64
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
769k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
769k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
769k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
769k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
769k
    _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
769k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
769k
    _operator_profile->add_child(_common_profile.get(), true);
557
769k
    _operator_profile->add_child(_custom_profile.get(), true);
558
769k
    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
769k
    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
769k
    _rows_returned_counter =
591
769k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
769k
    _blocks_returned_counter =
593
769k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
769k
    _output_block_bytes_counter =
595
769k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
769k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
769k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
769k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
769k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
769k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
769k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
769k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
769k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
769k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
769k
    _memory_used_counter =
606
769k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
769k
    _common_profile->add_info_string("IsColocate",
608
769k
                                     std::to_string(_parent->is_colocated_operator()));
609
769k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
769k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
769k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
769k
    return Status::OK();
613
769k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
53.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
53.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
53.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
53.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
53.0k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
53.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
53.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
53.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
53.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
53.0k
    if constexpr (!is_fake_shared) {
560
53.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
53.0k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
3.62k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
3.62k
            _dependency = _shared_state->create_source_dependency(
576
3.62k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
3.62k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
3.62k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
49.3k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
49.3k
        }
584
53.0k
    }
585
586
53.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
53.0k
    _rows_returned_counter =
591
53.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
53.0k
    _blocks_returned_counter =
593
53.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
53.0k
    _output_block_bytes_counter =
595
53.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
53.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
53.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
53.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
53.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
53.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
53.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
53.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
53.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
53.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
53.0k
    _memory_used_counter =
606
53.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
53.0k
    _common_profile->add_info_string("IsColocate",
608
53.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
53.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
53.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
53.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
53.0k
    return Status::OK();
613
53.0k
}
_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.28k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
4.28k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
4.28k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
4.28k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
4.28k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
4.28k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
4.28k
    _operator_profile->add_child(_common_profile.get(), true);
557
4.28k
    _operator_profile->add_child(_custom_profile.get(), true);
558
4.28k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
4.28k
    if constexpr (!is_fake_shared) {
560
4.28k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
4.28k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.23k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.23k
            _dependency = _shared_state->create_source_dependency(
576
4.23k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.23k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.23k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.23k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
52
        }
584
4.28k
    }
585
586
4.28k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
4.28k
    _rows_returned_counter =
591
4.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
4.28k
    _blocks_returned_counter =
593
4.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
4.28k
    _output_block_bytes_counter =
595
4.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
4.28k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
4.28k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
4.28k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
4.28k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
4.28k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
4.28k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
4.28k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
4.28k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
4.28k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
4.28k
    _memory_used_counter =
606
4.28k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
4.28k
    _common_profile->add_info_string("IsColocate",
608
4.28k
                                     std::to_string(_parent->is_colocated_operator()));
609
4.28k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
4.28k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
4.28k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
4.28k
    return Status::OK();
613
4.28k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
394
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
394
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
394
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
394
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
394
    _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
394
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
394
    _operator_profile->add_child(_common_profile.get(), true);
557
394
    _operator_profile->add_child(_custom_profile.get(), true);
558
394
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
394
    if constexpr (!is_fake_shared) {
560
394
        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
394
        } 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
393
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
393
            _dependency = _shared_state->create_source_dependency(
576
393
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
393
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
393
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
393
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
394
    }
585
586
394
    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
394
    _rows_returned_counter =
591
394
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
394
    _blocks_returned_counter =
593
394
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
394
    _output_block_bytes_counter =
595
394
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
394
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
394
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
394
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
394
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
394
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
394
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
394
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
394
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
394
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
394
    _memory_used_counter =
606
394
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
394
    _common_profile->add_info_string("IsColocate",
608
394
                                     std::to_string(_parent->is_colocated_operator()));
609
394
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
394
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
394
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
394
    return Status::OK();
613
394
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.23k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.23k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.23k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.23k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.23k
    _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.23k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.23k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.23k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.23k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.23k
    if constexpr (!is_fake_shared) {
560
5.23k
        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.23k
        } 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.19k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.19k
            _dependency = _shared_state->create_source_dependency(
576
5.19k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.19k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.19k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.19k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
39
        }
584
5.23k
    }
585
586
5.23k
    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.23k
    _rows_returned_counter =
591
5.23k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.23k
    _blocks_returned_counter =
593
5.23k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.23k
    _output_block_bytes_counter =
595
5.23k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.23k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.23k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.23k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.23k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.23k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.23k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.23k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.23k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.23k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.23k
    _memory_used_counter =
606
5.23k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.23k
    _common_profile->add_info_string("IsColocate",
608
5.23k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.23k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.23k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.23k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.23k
    return Status::OK();
613
5.23k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
542k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
542k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
542k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
542k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
542k
    _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
542k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
542k
    _operator_profile->add_child(_common_profile.get(), true);
557
542k
    _operator_profile->add_child(_custom_profile.get(), true);
558
542k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
542k
    if constexpr (!is_fake_shared) {
560
542k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
538k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
538k
                                    .first.get()
563
538k
                                    ->template cast<SharedStateArg>();
564
565
538k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
538k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
538k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
538k
        } 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.69k
        } else {
580
3.69k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
3.69k
                DCHECK(false);
582
3.69k
            }
583
3.69k
        }
584
542k
    }
585
586
542k
    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
542k
    _rows_returned_counter =
591
542k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
542k
    _blocks_returned_counter =
593
542k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
542k
    _output_block_bytes_counter =
595
542k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
542k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
542k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
542k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
542k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
542k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
542k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
542k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
542k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
542k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
542k
    _memory_used_counter =
606
542k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
542k
    _common_profile->add_info_string("IsColocate",
608
542k
                                     std::to_string(_parent->is_colocated_operator()));
609
542k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
542k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
542k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
542k
    return Status::OK();
613
542k
}
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.81M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.81M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.10M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
290k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
290k
    }
621
1.81M
    if (_parent->has_projection()) {
622
359k
        const auto& projection = *_parent->_projection;
623
359k
        _projections.resize(projection.projections.size());
624
2.22M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.86M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.86M
        }
627
359k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
373k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
13.6k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
184k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
170k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
170k
                        state, _intermediate_projections[i][j]));
633
170k
            }
634
13.6k
        }
635
359k
    }
636
1.81M
    return Status::OK();
637
1.81M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
65.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
65.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
66.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.18k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.18k
    }
621
65.6k
    if (_parent->has_projection()) {
622
65.6k
        const auto& projection = *_parent->_projection;
623
65.6k
        _projections.resize(projection.projections.size());
624
346k
        for (size_t i = 0; i < _projections.size(); i++) {
625
280k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
280k
        }
627
65.6k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
71.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
5.86k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
136k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
130k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
130k
                        state, _intermediate_projections[i][j]));
633
130k
            }
634
5.86k
        }
635
65.6k
    }
636
65.6k
    return Status::OK();
637
65.6k
}
_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
178k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
178k
    _conjuncts.resize(_parent->_conjuncts.size());
618
178k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
178k
    if (_parent->has_projection()) {
622
78
        const auto& projection = *_parent->_projection;
623
78
        _projections.resize(projection.projections.size());
624
396
        for (size_t i = 0; i < _projections.size(); i++) {
625
318
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
318
        }
627
78
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
78
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
78
    }
636
178k
    return Status::OK();
637
178k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
37
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
37
    _conjuncts.resize(_parent->_conjuncts.size());
618
37
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
37
    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
37
    return Status::OK();
637
37
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.89k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.89k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.01k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
126
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
126
    }
621
5.89k
    if (_parent->has_projection()) {
622
5.89k
        const auto& projection = *_parent->_projection;
623
5.89k
        _projections.resize(projection.projections.size());
624
25.6k
        for (size_t i = 0; i < _projections.size(); i++) {
625
19.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
19.7k
        }
627
5.89k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.91k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
25
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
172
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
147
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
147
                        state, _intermediate_projections[i][j]));
633
147
            }
634
25
        }
635
5.89k
    }
636
5.89k
    return Status::OK();
637
5.89k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.16k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.16k
    _conjuncts.resize(_parent->_conjuncts.size());
618
8.85k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
691
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
691
    }
621
8.16k
    if (_parent->has_projection()) {
622
4.20k
        const auto& projection = *_parent->_projection;
623
4.20k
        _projections.resize(projection.projections.size());
624
16.9k
        for (size_t i = 0; i < _projections.size(); i++) {
625
12.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
12.7k
        }
627
4.20k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.28k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
89
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
673
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
584
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
584
                        state, _intermediate_projections[i][j]));
633
584
            }
634
89
        }
635
4.20k
    }
636
8.16k
    return Status::OK();
637
8.16k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
85.1k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
85.1k
    _conjuncts.resize(_parent->_conjuncts.size());
618
86.5k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.34k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.34k
    }
621
85.1k
    if (_parent->has_projection()) {
622
28.1k
        const auto& projection = *_parent->_projection;
623
28.1k
        _projections.resize(projection.projections.size());
624
262k
        for (size_t i = 0; i < _projections.size(); i++) {
625
234k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
234k
        }
627
28.1k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
28.3k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
215
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.53k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
1.32k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
1.32k
                        state, _intermediate_projections[i][j]));
633
1.32k
            }
634
215
        }
635
28.1k
    }
636
85.1k
    return Status::OK();
637
85.1k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
85.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
85.9k
    _conjuncts.resize(_parent->_conjuncts.size());
618
85.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
20
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
20
    }
621
85.9k
    if (_parent->has_projection()) {
622
135
        const auto& projection = *_parent->_projection;
623
135
        _projections.resize(projection.projections.size());
624
550
        for (size_t i = 0; i < _projections.size(); i++) {
625
415
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
415
        }
627
135
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
136
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
1
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
2
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
2
                        state, _intermediate_projections[i][j]));
633
2
            }
634
1
        }
635
135
    }
636
85.9k
    return Status::OK();
637
85.9k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
68
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
68
    _conjuncts.resize(_parent->_conjuncts.size());
618
68
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
68
    if (_parent->has_projection()) {
622
22
        const auto& projection = *_parent->_projection;
623
22
        _projections.resize(projection.projections.size());
624
66
        for (size_t i = 0; i < _projections.size(); i++) {
625
44
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
44
        }
627
22
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
22
        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
22
    }
636
68
    return Status::OK();
637
68
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
774k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
774k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.06M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
286k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
286k
    }
621
774k
    if (_parent->has_projection()) {
622
244k
        const auto& projection = *_parent->_projection;
623
244k
        _projections.resize(projection.projections.size());
624
1.46M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.22M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.22M
        }
627
244k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
251k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.31k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
42.8k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
35.5k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
35.5k
                        state, _intermediate_projections[i][j]));
633
35.5k
            }
634
7.31k
        }
635
244k
    }
636
774k
    return Status::OK();
637
774k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
53.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
53.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
53.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
53.3k
    if (_parent->has_projection()) {
622
11.2k
        const auto& projection = *_parent->_projection;
623
11.2k
        _projections.resize(projection.projections.size());
624
109k
        for (size_t i = 0; i < _projections.size(); i++) {
625
97.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
97.7k
        }
627
11.2k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.3k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
136
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
2.62k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
2.48k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
2.48k
                        state, _intermediate_projections[i][j]));
633
2.48k
            }
634
136
        }
635
11.2k
    }
636
53.3k
    return Status::OK();
637
53.3k
}
_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.28k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
4.28k
    _conjuncts.resize(_parent->_conjuncts.size());
618
4.81k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
526
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
526
    }
621
4.28k
    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.28k
    return Status::OK();
637
4.28k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
394
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
394
    _conjuncts.resize(_parent->_conjuncts.size());
618
394
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
394
    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
394
    return Status::OK();
637
394
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.23k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.23k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.23k
    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.23k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
228
        for (size_t i = 0; i < _projections.size(); i++) {
625
168
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
168
        }
627
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
60
    }
636
5.23k
    return Status::OK();
637
5.23k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
545k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
545k
    _conjuncts.resize(_parent->_conjuncts.size());
618
545k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
545k
    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
545k
    return Status::OK();
637
545k
}
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
6.12k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.12k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.12k
    _terminated = true;
645
6.12k
    return Status::OK();
646
6.12k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
436
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
436
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
436
    _terminated = true;
645
436
    return Status::OK();
646
436
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
25
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
25
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
25
    _terminated = true;
645
25
    return Status::OK();
646
25
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
18
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
18
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
18
    _terminated = true;
645
18
    return Status::OK();
646
18
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
53
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
53
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
53
    _terminated = true;
645
53
    return Status::OK();
646
53
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4.67k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4.67k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
4.67k
    _terminated = true;
645
4.67k
    return Status::OK();
646
4.67k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
39
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
39
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
39
    _terminated = true;
645
39
    return Status::OK();
646
39
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
2
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
2
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
2
    _terminated = true;
645
2
    return Status::OK();
646
2
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
4
    _terminated = true;
645
4
    return Status::OK();
646
4
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
837
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
837
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
837
    _terminated = true;
645
837
    return Status::OK();
646
837
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
32
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
32
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
32
    _terminated = true;
645
32
    return Status::OK();
646
32
}
647
648
template <typename SharedStateArg>
649
2.01M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.01M
    if (_closed) {
651
206k
        return Status::OK();
652
206k
    }
653
1.81M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.03M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.03M
    }
656
1.81M
    _closed = true;
657
1.81M
    return Status::OK();
658
2.01M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
65.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
65.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
65.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
65.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
65.6k
    }
656
65.6k
    _closed = true;
657
65.6k
    return Status::OK();
658
65.6k
}
_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
353k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
353k
    if (_closed) {
651
177k
        return Status::OK();
652
177k
    }
653
176k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
176k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
176k
    }
656
176k
    _closed = true;
657
176k
    return Status::OK();
658
353k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
37
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
37
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
37
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
37
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
37
    }
656
37
    _closed = true;
657
37
    return Status::OK();
658
37
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.89k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.89k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.89k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.89k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.89k
    }
656
5.89k
    _closed = true;
657
5.89k
    return Status::OK();
658
5.89k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
16.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
16.4k
    if (_closed) {
651
8.26k
        return Status::OK();
652
8.26k
    }
653
8.14k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.14k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.14k
    }
656
8.14k
    _closed = true;
657
8.14k
    return Status::OK();
658
16.4k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
85.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
85.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
85.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
85.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
85.0k
    }
656
85.0k
    _closed = true;
657
85.0k
    return Status::OK();
658
85.0k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
85.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
85.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
85.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
85.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
85.5k
    }
656
85.5k
    _closed = true;
657
85.5k
    return Status::OK();
658
85.5k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
63
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
63
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
63
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
63
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
63
    }
656
63
    _closed = true;
657
63
    return Status::OK();
658
63
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
790k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
790k
    if (_closed) {
651
15.3k
        return Status::OK();
652
15.3k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
774k
    _closed = true;
657
774k
    return Status::OK();
658
790k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
53.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
53.3k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
53.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
53.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
53.3k
    }
656
53.3k
    _closed = true;
657
53.3k
    return Status::OK();
658
53.3k
}
_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.25k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4.25k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4.25k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4.25k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4.25k
    }
656
4.25k
    _closed = true;
657
4.25k
    return Status::OK();
658
4.25k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
585
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
585
    if (_closed) {
651
292
        return Status::OK();
652
292
    }
653
293
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
293
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
293
    }
656
293
    _closed = true;
657
293
    return Status::OK();
658
585
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.5k
    if (_closed) {
651
5.34k
        return Status::OK();
652
5.34k
    }
653
5.23k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.23k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.23k
    }
656
5.23k
    _closed = true;
657
5.23k
    return Status::OK();
658
10.5k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
546k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
546k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
546k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
546k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
546k
    }
656
546k
    _closed = true;
657
546k
    return Status::OK();
658
546k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
319
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
319
    if (_closed) {
651
164
        return Status::OK();
652
164
    }
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
319
}
659
660
template <typename SharedState>
661
1.53M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.53M
    _operator_profile =
664
1.53M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.53M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.53M
    _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.53M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.53M
    _operator_profile->add_child(_common_profile, true);
673
1.53M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.53M
    _operator_profile->set_metadata(_parent->node_id());
676
1.53M
    _wait_for_finish_dependency_timer =
677
1.53M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.53M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.53M
    if constexpr (!is_fake_shared) {
680
1.10M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.10M
            info.shared_state_map.end()) {
682
299k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
199k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
199k
            }
685
299k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
299k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
299k
                                                  ? 0
688
299k
                                                  : info.task_idx]
689
299k
                                  .get();
690
299k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
802k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
802k
            _shared_state = info.shared_state->template cast<SharedState>();
696
802k
            _dependency = _shared_state->create_sink_dependency(
697
802k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
802k
        }
699
1.10M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.10M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.10M
    }
702
703
1.53M
    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.53M
    _rows_input_counter =
708
1.53M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.53M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.53M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.53M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.53M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.53M
    _memory_used_counter =
714
1.53M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.53M
    _common_profile->add_info_string("IsColocate",
716
1.53M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.53M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.53M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.53M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.53M
    return Status::OK();
721
1.53M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
113k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
113k
    _operator_profile =
664
113k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
113k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
113k
    _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
113k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
113k
    _operator_profile->add_child(_common_profile, true);
673
113k
    _operator_profile->add_child(_custom_profile, true);
674
675
113k
    _operator_profile->set_metadata(_parent->node_id());
676
113k
    _wait_for_finish_dependency_timer =
677
113k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
113k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
113k
    if constexpr (!is_fake_shared) {
680
113k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
113k
            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
14.7k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
14.7k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
14.7k
                                                  ? 0
688
14.7k
                                                  : info.task_idx]
689
14.7k
                                  .get();
690
14.7k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
98.7k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
98.7k
            _shared_state = info.shared_state->template cast<SharedState>();
696
98.7k
            _dependency = _shared_state->create_sink_dependency(
697
98.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
98.7k
        }
699
113k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
113k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
113k
    }
702
703
113k
    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
113k
    _rows_input_counter =
708
113k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
113k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
113k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
113k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
113k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
113k
    _memory_used_counter =
714
113k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
113k
    _common_profile->add_info_string("IsColocate",
716
113k
                                     std::to_string(_parent->is_colocated_operator()));
717
113k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
113k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
113k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
113k
    return Status::OK();
721
113k
}
_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
177k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
177k
    _operator_profile =
664
177k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
177k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
177k
    _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
177k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
177k
    _operator_profile->add_child(_common_profile, true);
673
177k
    _operator_profile->add_child(_custom_profile, true);
674
675
177k
    _operator_profile->set_metadata(_parent->node_id());
676
177k
    _wait_for_finish_dependency_timer =
677
177k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
177k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
177k
    if constexpr (!is_fake_shared) {
680
177k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
177k
            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
177k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
177k
            _shared_state = info.shared_state->template cast<SharedState>();
696
177k
            _dependency = _shared_state->create_sink_dependency(
697
177k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
177k
        }
699
177k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
177k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
177k
    }
702
703
177k
    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
177k
    _rows_input_counter =
708
177k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
177k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
177k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
177k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
177k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
177k
    _memory_used_counter =
714
177k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
177k
    _common_profile->add_info_string("IsColocate",
716
177k
                                     std::to_string(_parent->is_colocated_operator()));
717
177k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
177k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
177k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
177k
    return Status::OK();
721
177k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
44
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
44
    _operator_profile =
664
44
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
44
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
44
    _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
44
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
44
    _operator_profile->add_child(_common_profile, true);
673
44
    _operator_profile->add_child(_custom_profile, true);
674
675
44
    _operator_profile->set_metadata(_parent->node_id());
676
44
    _wait_for_finish_dependency_timer =
677
44
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
44
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
44
    if constexpr (!is_fake_shared) {
680
44
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
44
            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
44
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
44
            _shared_state = info.shared_state->template cast<SharedState>();
696
44
            _dependency = _shared_state->create_sink_dependency(
697
44
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
44
        }
699
44
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
44
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
44
    }
702
703
44
    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
44
    _rows_input_counter =
708
44
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
44
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
44
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
44
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
44
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
44
    _memory_used_counter =
714
44
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
44
    _common_profile->add_info_string("IsColocate",
716
44
                                     std::to_string(_parent->is_colocated_operator()));
717
44
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
44
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
44
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
44
    return Status::OK();
721
44
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.88k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.88k
    _operator_profile =
664
5.88k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.88k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.88k
    _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.88k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.88k
    _operator_profile->add_child(_common_profile, true);
673
5.88k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.88k
    _operator_profile->set_metadata(_parent->node_id());
676
5.88k
    _wait_for_finish_dependency_timer =
677
5.88k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.88k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.88k
    if constexpr (!is_fake_shared) {
680
5.88k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.88k
            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.88k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.88k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.88k
            _dependency = _shared_state->create_sink_dependency(
697
5.88k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.88k
        }
699
5.88k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.88k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.88k
    }
702
703
5.88k
    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.88k
    _rows_input_counter =
708
5.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.88k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.88k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.88k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.88k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.88k
    _memory_used_counter =
714
5.88k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.88k
    _common_profile->add_info_string("IsColocate",
716
5.88k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.88k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.88k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.88k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.88k
    return Status::OK();
721
5.88k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.14k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.14k
    _operator_profile =
664
8.14k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.14k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.14k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.14k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.14k
    _operator_profile->add_child(_common_profile, true);
673
8.14k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.14k
    _operator_profile->set_metadata(_parent->node_id());
676
8.14k
    _wait_for_finish_dependency_timer =
677
8.14k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.14k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.14k
    if constexpr (!is_fake_shared) {
680
8.14k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.14k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.14k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.14k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.14k
            _dependency = _shared_state->create_sink_dependency(
697
8.14k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.14k
        }
699
8.14k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.14k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.14k
    }
702
703
8.14k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.14k
    _rows_input_counter =
708
8.14k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.14k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.14k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.14k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.14k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.14k
    _memory_used_counter =
714
8.14k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.14k
    _common_profile->add_info_string("IsColocate",
716
8.14k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.14k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.14k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.14k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.14k
    return Status::OK();
721
8.14k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
85.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
85.0k
    _operator_profile =
664
85.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
85.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
85.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
85.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
85.0k
    _operator_profile->add_child(_common_profile, true);
673
85.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
85.0k
    _operator_profile->set_metadata(_parent->node_id());
676
85.0k
    _wait_for_finish_dependency_timer =
677
85.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
85.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
85.0k
    if constexpr (!is_fake_shared) {
680
85.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
85.0k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
85.0k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
85.0k
            _shared_state = info.shared_state->template cast<SharedState>();
696
85.0k
            _dependency = _shared_state->create_sink_dependency(
697
85.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
85.0k
        }
699
85.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
85.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
85.0k
    }
702
703
85.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
85.0k
    _rows_input_counter =
708
85.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
85.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
85.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
85.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
85.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
85.0k
    _memory_used_counter =
714
85.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
85.0k
    _common_profile->add_info_string("IsColocate",
716
85.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
85.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
85.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
85.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
85.0k
    return Status::OK();
721
85.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
85.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
85.8k
    _operator_profile =
664
85.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
85.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
85.8k
    _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
85.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
85.8k
    _operator_profile->add_child(_common_profile, true);
673
85.8k
    _operator_profile->add_child(_custom_profile, true);
674
675
85.8k
    _operator_profile->set_metadata(_parent->node_id());
676
85.8k
    _wait_for_finish_dependency_timer =
677
85.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
85.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
85.8k
    if constexpr (!is_fake_shared) {
680
85.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
85.9k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
85.9k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
85.9k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
85.9k
                                                  ? 0
688
85.9k
                                                  : info.task_idx]
689
85.9k
                                  .get();
690
85.9k
            _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
85.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
85.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
85.8k
    }
702
703
85.8k
    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
85.8k
    _rows_input_counter =
708
85.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
85.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
85.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
85.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
85.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
85.8k
    _memory_used_counter =
714
85.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
85.8k
    _common_profile->add_info_string("IsColocate",
716
85.8k
                                     std::to_string(_parent->is_colocated_operator()));
717
85.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
85.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
85.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
85.8k
    return Status::OK();
721
85.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
74
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
74
    _operator_profile =
664
74
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
74
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
74
    _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
74
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
74
    _operator_profile->add_child(_common_profile, true);
673
74
    _operator_profile->add_child(_custom_profile, true);
674
675
74
    _operator_profile->set_metadata(_parent->node_id());
676
74
    _wait_for_finish_dependency_timer =
677
74
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
74
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
74
    if constexpr (!is_fake_shared) {
680
74
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
74
            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
74
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
74
            _shared_state = info.shared_state->template cast<SharedState>();
696
74
            _dependency = _shared_state->create_sink_dependency(
697
74
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
74
        }
699
74
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
74
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
74
    }
702
703
74
    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
74
    _rows_input_counter =
708
74
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
74
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
74
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
74
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
74
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
74
    _memory_used_counter =
714
74
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
74
    _common_profile->add_info_string("IsColocate",
716
74
                                     std::to_string(_parent->is_colocated_operator()));
717
74
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
74
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
74
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
74
    return Status::OK();
721
74
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
433k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
433k
    _operator_profile =
664
433k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
433k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
433k
    _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
433k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
433k
    _operator_profile->add_child(_common_profile, true);
673
433k
    _operator_profile->add_child(_custom_profile, true);
674
675
433k
    _operator_profile->set_metadata(_parent->node_id());
676
433k
    _wait_for_finish_dependency_timer =
677
433k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
433k
    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
433k
    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
433k
    _rows_input_counter =
708
433k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
433k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
433k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
433k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
433k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
433k
    _memory_used_counter =
714
433k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
433k
    _common_profile->add_info_string("IsColocate",
716
433k
                                     std::to_string(_parent->is_colocated_operator()));
717
433k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
433k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
433k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
433k
    return Status::OK();
721
433k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.94k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.94k
    _operator_profile =
664
7.94k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.94k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.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
7.94k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.94k
    _operator_profile->add_child(_common_profile, true);
673
7.94k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.94k
    _operator_profile->set_metadata(_parent->node_id());
676
7.94k
    _wait_for_finish_dependency_timer =
677
7.94k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.94k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.94k
    if constexpr (!is_fake_shared) {
680
7.94k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.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
7.94k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.94k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.94k
            _dependency = _shared_state->create_sink_dependency(
697
7.94k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.94k
        }
699
7.94k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.94k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.94k
    }
702
703
7.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
7.94k
    _rows_input_counter =
708
7.94k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.94k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.94k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.94k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.94k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.94k
    _memory_used_counter =
714
7.94k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.94k
    _common_profile->add_info_string("IsColocate",
716
7.94k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.94k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.94k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.94k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.94k
    return Status::OK();
721
7.94k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
395
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
395
    _operator_profile =
664
395
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
395
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
395
    _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
395
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
395
    _operator_profile->add_child(_common_profile, true);
673
395
    _operator_profile->add_child(_custom_profile, true);
674
675
395
    _operator_profile->set_metadata(_parent->node_id());
676
395
    _wait_for_finish_dependency_timer =
677
395
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
395
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
395
    if constexpr (!is_fake_shared) {
680
395
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
395
            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
395
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
395
            _shared_state = info.shared_state->template cast<SharedState>();
696
395
            _dependency = _shared_state->create_sink_dependency(
697
395
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
395
        }
699
395
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
395
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
395
    }
702
703
395
    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
395
    _rows_input_counter =
708
395
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
395
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
395
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
395
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
395
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
395
    _memory_used_counter =
714
395
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
395
    _common_profile->add_info_string("IsColocate",
716
395
                                     std::to_string(_parent->is_colocated_operator()));
717
395
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
395
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
395
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
395
    return Status::OK();
721
395
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
1.60k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.60k
    _operator_profile =
664
1.60k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.60k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.60k
    _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.60k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.60k
    _operator_profile->add_child(_common_profile, true);
673
1.60k
    _operator_profile->add_child(_custom_profile, true);
674
675
1.60k
    _operator_profile->set_metadata(_parent->node_id());
676
1.60k
    _wait_for_finish_dependency_timer =
677
1.60k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.60k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.60k
    if constexpr (!is_fake_shared) {
680
1.60k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.60k
            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.60k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
1.60k
            _shared_state = info.shared_state->template cast<SharedState>();
696
1.60k
            _dependency = _shared_state->create_sink_dependency(
697
1.60k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
1.60k
        }
699
1.60k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.60k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.60k
    }
702
703
1.60k
    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.60k
    _rows_input_counter =
708
1.60k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.60k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.60k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.60k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.60k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.60k
    _memory_used_counter =
714
1.60k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.60k
    _common_profile->add_info_string("IsColocate",
716
1.60k
                                     std::to_string(_parent->is_colocated_operator()));
717
1.60k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.60k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.60k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.60k
    return Status::OK();
721
1.60k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.9k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.9k
    _operator_profile =
664
12.9k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.9k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.9k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.9k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.9k
    _operator_profile->add_child(_common_profile, true);
673
12.9k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.9k
    _operator_profile->set_metadata(_parent->node_id());
676
12.9k
    _wait_for_finish_dependency_timer =
677
12.9k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.9k
    if constexpr (!is_fake_shared) {
680
12.9k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.9k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.9k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.9k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.9k
            _dependency = _shared_state->create_sink_dependency(
697
12.9k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.9k
        }
699
12.9k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.9k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.9k
    }
702
703
12.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.9k
    _rows_input_counter =
708
12.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.9k
    _memory_used_counter =
714
12.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.9k
    _common_profile->add_info_string("IsColocate",
716
12.9k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.9k
    return Status::OK();
721
12.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
198k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
198k
    _operator_profile =
664
198k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
198k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
198k
    _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
198k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
198k
    _operator_profile->add_child(_common_profile, true);
673
198k
    _operator_profile->add_child(_custom_profile, true);
674
675
198k
    _operator_profile->set_metadata(_parent->node_id());
676
198k
    _wait_for_finish_dependency_timer =
677
198k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
198k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
198k
    if constexpr (!is_fake_shared) {
680
198k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
199k
            info.shared_state_map.end()) {
682
199k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
199k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
199k
            }
685
199k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
199k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
199k
                                                  ? 0
688
199k
                                                  : info.task_idx]
689
199k
                                  .get();
690
199k
            _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
198k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
198k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
198k
    }
702
703
198k
    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
198k
    _rows_input_counter =
708
198k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
198k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
198k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
198k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
198k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
198k
    _memory_used_counter =
714
198k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
198k
    _common_profile->add_info_string("IsColocate",
716
198k
                                     std::to_string(_parent->is_colocated_operator()));
717
198k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
198k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
198k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
198k
    return Status::OK();
721
198k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
404k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
404k
    _operator_profile =
664
404k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
404k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
404k
    _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
404k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
404k
    _operator_profile->add_child(_common_profile, true);
673
404k
    _operator_profile->add_child(_custom_profile, true);
674
675
404k
    _operator_profile->set_metadata(_parent->node_id());
676
404k
    _wait_for_finish_dependency_timer =
677
404k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
404k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
404k
    if constexpr (!is_fake_shared) {
680
404k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
404k
            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
404k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
404k
            _shared_state = info.shared_state->template cast<SharedState>();
696
404k
            _dependency = _shared_state->create_sink_dependency(
697
404k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
404k
        }
699
404k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
404k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
404k
    }
702
703
404k
    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
404k
    _rows_input_counter =
708
404k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
404k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
404k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
404k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
404k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
404k
    _memory_used_counter =
714
404k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
404k
    _common_profile->add_info_string("IsColocate",
716
404k
                                     std::to_string(_parent->is_colocated_operator()));
717
404k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
404k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
404k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
404k
    return Status::OK();
721
404k
}
_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.54M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.54M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.54M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.10M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.10M
    }
731
1.54M
    _closed = true;
732
1.54M
    return Status::OK();
733
1.54M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
113k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
113k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
113k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
113k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
113k
    }
731
113k
    _closed = true;
732
113k
    return Status::OK();
733
113k
}
_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
177k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
177k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
177k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
177k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
177k
    }
731
177k
    _closed = true;
732
177k
    return Status::OK();
733
177k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
35
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
35
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
33
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
33
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
33
    }
731
33
    _closed = true;
732
33
    return Status::OK();
733
35
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.87k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.87k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.87k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.87k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.87k
    }
731
5.87k
    _closed = true;
732
5.87k
    return Status::OK();
733
5.87k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.12k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.12k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.12k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.12k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.12k
    }
731
8.12k
    _closed = true;
732
8.12k
    return Status::OK();
733
8.12k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
84.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
84.8k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
84.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
84.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
84.8k
    }
731
84.8k
    _closed = true;
732
84.8k
    return Status::OK();
733
84.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
85.5k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
85.5k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
85.5k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
85.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
85.5k
    }
731
85.5k
    _closed = true;
732
85.5k
    return Status::OK();
733
85.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
62
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
62
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
62
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
62
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
62
    }
731
62
    _closed = true;
732
62
    return Status::OK();
733
62
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
436k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
436k
    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
436k
    _closed = true;
732
436k
    return Status::OK();
733
436k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.98k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.98k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.98k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.98k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.98k
    }
731
7.98k
    _closed = true;
732
7.98k
    return Status::OK();
733
7.98k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
293
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
293
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
293
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
293
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
293
    }
731
293
    _closed = true;
732
293
    return Status::OK();
733
293
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1.61k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.61k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1.61k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.61k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.61k
    }
731
1.61k
    _closed = true;
732
1.61k
    return Status::OK();
733
1.61k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.9k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.9k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.9k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.9k
    }
731
12.9k
    _closed = true;
732
12.9k
    return Status::OK();
733
12.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
199k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
199k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
199k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
199k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
199k
    }
731
199k
    _closed = true;
732
199k
    return Status::OK();
733
199k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
405k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
405k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
405k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
405k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
405k
    }
731
405k
    _closed = true;
732
405k
    return Status::OK();
733
405k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
14
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
14
    }
731
14
    _closed = true;
732
14
    return Status::OK();
733
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
328
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
328
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
328
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
328
    }
731
328
    _closed = true;
732
328
    return Status::OK();
733
328
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
4.10k
                                                          bool* eos) {
738
4.10k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.10k
    return pull(state, block, eos);
740
4.10k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
38
                                                          bool* eos) {
738
38
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
38
    return pull(state, block, eos);
740
38
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.07k
                                                          bool* eos) {
738
4.07k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.06k
    return pull(state, block, eos);
740
4.07k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
501k
                                                         bool* eos) {
745
501k
    auto& local_state = get_local_state(state);
746
501k
    if (need_more_input_data(state)) {
747
470k
        local_state._child_block->clear_column_data(
748
470k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
470k
                        .num_materialized_slots());
750
470k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
470k
                state, local_state._child_block.get(), &local_state._child_eos));
752
470k
        *eos = local_state._child_eos;
753
470k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
82.6k
            return Status::OK();
755
82.6k
        }
756
387k
        {
757
387k
            SCOPED_TIMER(local_state.exec_time_counter());
758
387k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
387k
        }
760
387k
    }
761
762
418k
    if (!need_more_input_data(state)) {
763
393k
        SCOPED_TIMER(local_state.exec_time_counter());
764
393k
        bool new_eos = false;
765
393k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
393k
        if (new_eos) {
767
314k
            *eos = true;
768
314k
        } else if (!need_more_input_data(state)) {
769
25.0k
            *eos = false;
770
25.0k
        }
771
393k
    }
772
418k
    return Status::OK();
773
418k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
134k
                                                         bool* eos) {
745
134k
    auto& local_state = get_local_state(state);
746
134k
    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
36.0k
            return Status::OK();
755
36.0k
        }
756
81.0k
        {
757
81.0k
            SCOPED_TIMER(local_state.exec_time_counter());
758
81.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
81.0k
        }
760
81.0k
    }
761
762
98.6k
    if (!need_more_input_data(state)) {
763
98.6k
        SCOPED_TIMER(local_state.exec_time_counter());
764
98.6k
        bool new_eos = false;
765
98.6k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
98.6k
        if (new_eos) {
767
41.2k
            *eos = true;
768
57.4k
        } else if (!need_more_input_data(state)) {
769
10.6k
            *eos = false;
770
10.6k
        }
771
98.6k
    }
772
98.6k
    return Status::OK();
773
98.6k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.16k
                                                         bool* eos) {
745
4.16k
    auto& local_state = get_local_state(state);
746
4.16k
    if (need_more_input_data(state)) {
747
2.21k
        local_state._child_block->clear_column_data(
748
2.21k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.21k
                        .num_materialized_slots());
750
2.21k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.21k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.21k
        *eos = local_state._child_eos;
753
2.21k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
299
            return Status::OK();
755
299
        }
756
1.91k
        {
757
1.91k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.91k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.91k
        }
760
1.91k
    }
761
762
3.87k
    if (!need_more_input_data(state)) {
763
3.87k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.87k
        bool new_eos = false;
765
3.87k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.87k
        if (new_eos) {
767
1.31k
            *eos = true;
768
2.55k
        } else if (!need_more_input_data(state)) {
769
1.94k
            *eos = false;
770
1.94k
        }
771
3.87k
    }
772
3.86k
    return Status::OK();
773
3.86k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.82k
                                                         bool* eos) {
745
1.82k
    auto& local_state = get_local_state(state);
746
1.82k
    if (need_more_input_data(state)) {
747
1.82k
        local_state._child_block->clear_column_data(
748
1.82k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.82k
                        .num_materialized_slots());
750
1.82k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.82k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.82k
        *eos = local_state._child_eos;
753
1.82k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
766
            return Status::OK();
755
766
        }
756
1.06k
        {
757
1.06k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.06k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.06k
        }
760
1.06k
    }
761
762
1.06k
    if (!need_more_input_data(state)) {
763
1.06k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.06k
        bool new_eos = false;
765
1.06k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.06k
        if (new_eos) {
767
785
            *eos = true;
768
785
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.06k
    }
772
1.06k
    return Status::OK();
773
1.06k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
19.1k
                                                         bool* eos) {
745
19.1k
    auto& local_state = get_local_state(state);
746
19.1k
    if (need_more_input_data(state)) {
747
19.1k
        local_state._child_block->clear_column_data(
748
19.1k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
19.1k
                        .num_materialized_slots());
750
19.1k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
19.1k
                state, local_state._child_block.get(), &local_state._child_eos));
752
19.1k
        *eos = local_state._child_eos;
753
19.1k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
5.66k
            return Status::OK();
755
5.66k
        }
756
13.5k
        {
757
13.5k
            SCOPED_TIMER(local_state.exec_time_counter());
758
13.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
13.5k
        }
760
13.5k
    }
761
762
13.5k
    if (!need_more_input_data(state)) {
763
5.94k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.94k
        bool new_eos = false;
765
5.94k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.94k
        if (new_eos) {
767
5.88k
            *eos = true;
768
5.88k
        } else if (!need_more_input_data(state)) {
769
1
            *eos = false;
770
1
        }
771
5.94k
    }
772
13.5k
    return Status::OK();
773
13.5k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
312k
                                                         bool* eos) {
745
312k
    auto& local_state = get_local_state(state);
746
312k
    if (need_more_input_data(state)) {
747
312k
        local_state._child_block->clear_column_data(
748
312k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
312k
                        .num_materialized_slots());
750
312k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
312k
                state, local_state._child_block.get(), &local_state._child_eos));
752
312k
        *eos = local_state._child_eos;
753
312k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
38.3k
            return Status::OK();
755
38.3k
        }
756
274k
        {
757
274k
            SCOPED_TIMER(local_state.exec_time_counter());
758
274k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
274k
        }
760
274k
    }
761
762
273k
    if (!need_more_input_data(state)) {
763
255k
        SCOPED_TIMER(local_state.exec_time_counter());
764
255k
        bool new_eos = false;
765
255k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
255k
        if (new_eos) {
767
255k
            *eos = true;
768
255k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
255k
    }
772
273k
    return Status::OK();
773
273k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
22.4k
                                                         bool* eos) {
745
22.4k
    auto& local_state = get_local_state(state);
746
22.4k
    if (need_more_input_data(state)) {
747
10.3k
        local_state._child_block->clear_column_data(
748
10.3k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.3k
                        .num_materialized_slots());
750
10.3k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.3k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.3k
        *eos = local_state._child_eos;
753
10.3k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
632
            return Status::OK();
755
632
        }
756
9.70k
        {
757
9.70k
            SCOPED_TIMER(local_state.exec_time_counter());
758
9.70k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
9.70k
        }
760
9.70k
    }
761
762
21.7k
    if (!need_more_input_data(state)) {
763
21.1k
        SCOPED_TIMER(local_state.exec_time_counter());
764
21.1k
        bool new_eos = false;
765
21.1k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
21.1k
        if (new_eos) {
767
5.86k
            *eos = true;
768
15.2k
        } else if (!need_more_input_data(state)) {
769
12.0k
            *eos = false;
770
12.0k
        }
771
21.1k
    }
772
21.7k
    return Status::OK();
773
21.7k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.20k
                                                         bool* eos) {
745
7.20k
    auto& local_state = get_local_state(state);
746
7.20k
    if (need_more_input_data(state)) {
747
6.84k
        local_state._child_block->clear_column_data(
748
6.84k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.84k
                        .num_materialized_slots());
750
6.84k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.84k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.84k
        *eos = local_state._child_eos;
753
6.84k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
848
            return Status::OK();
755
848
        }
756
5.99k
        {
757
5.99k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.99k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.99k
        }
760
5.99k
    }
761
762
6.35k
    if (!need_more_input_data(state)) {
763
6.35k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.35k
        bool new_eos = false;
765
6.35k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.35k
        if (new_eos) {
767
4.24k
            *eos = true;
768
4.24k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.35k
    }
772
6.34k
    return Status::OK();
773
6.34k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
45.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
45.7k
    RETURN_IF_ERROR(Base::init(state, info));
779
45.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
45.7k
                                                         "AsyncWriterDependency", true);
781
45.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
45.7k
                             _finish_dependency));
783
784
45.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
45.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
45.7k
    return Status::OK();
787
45.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
355
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
355
    RETURN_IF_ERROR(Base::init(state, info));
779
355
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
355
                                                         "AsyncWriterDependency", true);
781
355
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
355
                             _finish_dependency));
783
784
355
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
355
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
355
    return Status::OK();
787
355
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
45.4k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
45.4k
    RETURN_IF_ERROR(Base::init(state, info));
779
45.4k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
45.4k
                                                         "AsyncWriterDependency", true);
781
45.4k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
45.4k
                             _finish_dependency));
783
784
45.4k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
45.4k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
45.4k
    return Status::OK();
787
45.4k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
8
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
8
    RETURN_IF_ERROR(Base::init(state, info));
779
8
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
8
                                                         "AsyncWriterDependency", true);
781
8
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
8
                             _finish_dependency));
783
784
8
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
8
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
8
    return Status::OK();
787
8
}
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
46.2k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.2k
    RETURN_IF_ERROR(Base::open(state));
793
46.2k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
360k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
314k
        RETURN_IF_ERROR(
796
314k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
314k
    }
798
46.2k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.2k
    return Status::OK();
800
46.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
355
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
355
    RETURN_IF_ERROR(Base::open(state));
793
355
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.84k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.49k
        RETURN_IF_ERROR(
796
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.49k
    }
798
355
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
355
    return Status::OK();
800
355
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
45.8k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
45.8k
    RETURN_IF_ERROR(Base::open(state));
793
45.8k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
358k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
312k
        RETURN_IF_ERROR(
796
312k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
312k
    }
798
45.8k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
45.8k
    return Status::OK();
800
45.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
8
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
8
    RETURN_IF_ERROR(Base::open(state));
793
8
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
144
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
136
        RETURN_IF_ERROR(
796
136
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
136
    }
798
8
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
8
    return Status::OK();
800
8
}
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
61.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.5k
    return _writer->sink(block, eos);
806
61.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.70k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.70k
    return _writer->sink(block, eos);
806
1.70k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
59.8k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
59.8k
    return _writer->sink(block, eos);
806
59.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
8
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
8
    return _writer->sink(block, eos);
806
8
}
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
46.3k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
46.3k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
46.3k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
46.3k
    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
46.3k
    if (_writer) {
818
46.3k
        Status st = _writer->get_writer_status();
819
46.3k
        if (exec_status.ok()) {
820
46.2k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
46.2k
                                                       : Status::Cancelled("force close"));
822
46.2k
        } else {
823
85
            _writer->force_close(exec_status);
824
85
        }
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
46.3k
        RETURN_IF_ERROR(st);
829
46.3k
    }
830
46.2k
    return Base::close(state, exec_status);
831
46.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
343
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
343
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
343
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
343
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
343
    if (_writer) {
818
343
        Status st = _writer->get_writer_status();
819
343
        if (exec_status.ok()) {
820
343
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
343
                                                       : Status::Cancelled("force close"));
822
343
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
343
        RETURN_IF_ERROR(st);
829
343
    }
830
343
    return Base::close(state, exec_status);
831
343
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
45.9k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
45.9k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
45.9k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
45.9k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
46.0k
    if (_writer) {
818
46.0k
        Status st = _writer->get_writer_status();
819
46.0k
        if (exec_status.ok()) {
820
45.9k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
45.9k
                                                       : Status::Cancelled("force close"));
822
45.9k
        } else {
823
85
            _writer->force_close(exec_status);
824
85
        }
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
46.0k
        RETURN_IF_ERROR(st);
829
46.0k
    }
830
45.9k
    return Base::close(state, exec_status);
831
45.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
8
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
8
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
8
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
8
    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
8
    if (_writer) {
818
8
        Status st = _writer->get_writer_status();
819
8
        if (exec_status.ok()) {
820
8
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
8
                                                       : Status::Cancelled("force close"));
822
8
        } 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
8
        RETURN_IF_ERROR(st);
829
8
    }
830
8
    return Base::close(state, exec_status);
831
8
}
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