Coverage Report

Created: 2026-09-07 12:30

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.76M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.76M
    if (_parent->nereids_id() == -1) {
122
919k
        return fmt::format("(id={})", _parent->node_id());
123
919k
    } else {
124
848k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
848k
    }
126
1.76M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
67.3k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
67.3k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
67.3k
    } else {
124
67.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
67.3k
    }
126
67.3k
}
_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
205k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
205k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
205k
    } else {
124
205k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
205k
    }
126
205k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
26
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
26
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.68k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.68k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
6.68k
    } else {
124
6.68k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.68k
    }
126
6.68k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
7.15k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
7.15k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
7.14k
    } else {
124
7.14k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7.14k
    }
126
7.15k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
87.2k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
87.2k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
87.2k
    } else {
124
87.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
87.2k
    }
126
87.2k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
77.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
77.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
77.1k
    } else {
124
77.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
77.1k
    }
126
77.1k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
200
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
200
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
200
    } else {
124
200
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
200
    }
126
200
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
621k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
621k
    if (_parent->nereids_id() == -1) {
122
282k
        return fmt::format("(id={})", _parent->node_id());
123
339k
    } else {
124
339k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
339k
    }
126
621k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
52.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
52.8k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
52.8k
    } else {
124
52.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
52.8k
    }
126
52.8k
}
_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
6.20k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.22k
    if (_parent->nereids_id() == -1) {
122
6.22k
        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
6.20k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
446
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
446
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
344
    } else {
124
344
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
344
    }
126
446
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.09k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.09k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.08k
    } else {
124
5.08k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.08k
    }
126
5.09k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
630k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
630k
    if (_parent->nereids_id() == -1) {
122
630k
        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
630k
}
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.17M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.17M
    if (_parent->nereids_id() == -1) {
131
669k
        return fmt::format("(id={})", _parent->node_id());
132
669k
    } else {
133
510k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
510k
    }
135
1.17M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
115k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
115k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
115k
    } else {
133
115k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
115k
    }
135
115k
}
_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
208k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
208k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
208k
    } else {
133
208k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
208k
    }
135
208k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
32
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
32
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
32
    } else {
133
32
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
32
    }
135
32
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
6.73k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6.73k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
6.73k
    } else {
133
6.73k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
6.73k
    }
135
6.73k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.15k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.15k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
7.14k
    } else {
133
7.14k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.14k
    }
135
7.15k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
87.8k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
87.8k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
87.7k
    } else {
133
87.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
87.7k
    }
135
87.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
76.8k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
76.8k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
76.8k
    } else {
133
76.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
76.8k
    }
135
76.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
210
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
210
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
210
    } else {
133
210
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
210
    }
135
210
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
9
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
9
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.85k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.85k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
7.85k
    } else {
133
7.85k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.85k
    }
135
7.85k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
446
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
446
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
344
    } else {
133
344
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
344
    }
135
446
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.4k
    if (_parent->nereids_id() == -1) {
131
12.4k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
234k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
235k
    if (_parent->nereids_id() == -1) {
131
235k
        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
234k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
421k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
421k
    if (_parent->nereids_id() == -1) {
131
421k
        return fmt::format("(id={})", _parent->node_id());
132
421k
    } else {
133
295
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
295
    }
135
421k
}
_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.6k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.6k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
29.6k
    _terminated = true;
143
29.6k
    return Status::OK();
144
29.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.57k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.57k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.57k
    _terminated = true;
143
1.57k
    return Status::OK();
144
1.57k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
5
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
5
    _terminated = true;
143
5
    return Status::OK();
144
5
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.80k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.80k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.80k
    _terminated = true;
143
1.80k
    return Status::OK();
144
1.80k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
765
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
765
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
765
    _terminated = true;
143
765
    return Status::OK();
144
765
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_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_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
364
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
364
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
364
    _terminated = true;
143
364
    return Status::OK();
144
364
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
358
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
358
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
358
    _terminated = true;
143
358
    return Status::OK();
144
358
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
6
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
6
    _terminated = true;
143
6
    return Status::OK();
144
6
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
261
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
261
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
261
    _terminated = true;
143
261
    return Status::OK();
144
261
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
14
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
14
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
14
    _terminated = true;
143
14
    return Status::OK();
144
14
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
335
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
335
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
335
    _terminated = true;
143
335
    return Status::OK();
144
335
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
126
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
126
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
126
    _terminated = true;
143
126
    return Status::OK();
144
126
}
145
146
297k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
297k
    return _child && _child->is_serial_operator() && !is_source()
148
297k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
297k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
297k
}
151
152
21.2k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
21.2k
    if (!_child) {
154
19.8k
        return false;
155
19.8k
    }
156
1.39k
    if (_child->is_serial_operator()) {
157
175
        return true;
158
175
    }
159
1.21k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.21k
    return child_distribution.need_local_exchange() &&
161
1.21k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.39k
}
163
164
template <typename SharedStateArg>
165
19.2k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.2k
    fmt::memory_buffer debug_string_buffer;
167
19.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.2k
    return fmt::to_string(debug_string_buffer);
169
19.2k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
19.2k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.2k
    fmt::memory_buffer debug_string_buffer;
167
19.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.2k
    return fmt::to_string(debug_string_buffer);
169
19.2k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
19.2k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.2k
    fmt::memory_buffer debug_string_buffer;
174
19.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.2k
    return fmt::to_string(debug_string_buffer);
176
19.2k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
19.2k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.2k
    fmt::memory_buffer debug_string_buffer;
174
19.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.2k
    return fmt::to_string(debug_string_buffer);
176
19.2k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
19.3k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
19.3k
    fmt::memory_buffer debug_string_buffer;
180
19.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
19.3k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
19.3k
                   _is_serial_operator);
183
19.3k
    return fmt::to_string(debug_string_buffer);
184
19.3k
}
185
186
19.2k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
19.2k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
19.2k
}
189
190
632k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
632k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
632k
    _nereids_id = tnode.nereids_id;
193
632k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.60k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.60k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.60k
            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.60k
    }
206
632k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
632k
    _op_name = substr + "_OPERATOR";
208
209
632k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
632k
    } 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.1k
    }
218
219
    // create the projections expr
220
632k
    if (tnode.__isset.projections) {
221
247k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
247k
    }
223
632k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.61k
        DCHECK(has_projection()) << "no final projections";
225
3.61k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
5.86k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
5.86k
            VExprContextSPtrs projections;
228
5.86k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
5.86k
            _projection->intermediate_projections.push_back(projections);
230
5.86k
        }
231
3.61k
    }
232
632k
    return Status::OK();
233
632k
}
234
235
660k
Status OperatorXBase::prepare(RuntimeState* state) {
236
660k
    for (auto& conjunct : _conjuncts) {
237
262k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
262k
    }
239
660k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
610k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
334k
            return a->execute_cost() < b->execute_cost();
242
334k
        });
243
610k
    };
244
245
660k
    if (has_projection()) {
246
246k
        auto& projection = *_projection;
247
252k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
5.86k
            const auto& input_row_desc =
249
5.86k
                    i == 0 ? operator_row_desc_before_projection()
250
5.86k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
5.86k
            RETURN_IF_ERROR(
252
5.86k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
5.86k
        }
254
246k
        const auto& final_projection_input_row_desc =
255
246k
                projection.intermediate_output_row_descriptors.empty()
256
246k
                        ? operator_row_desc_before_projection()
257
246k
                        : projection.intermediate_output_row_descriptors.back();
258
246k
        RETURN_IF_ERROR(
259
246k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
246k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
246k
                                                      projection.output_row_descriptor));
262
246k
    }
263
264
660k
    for (auto& conjunct : _conjuncts) {
265
262k
        RETURN_IF_ERROR(conjunct->open(state));
266
262k
    }
267
660k
    if (has_projection()) {
268
246k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
246k
        for (auto& projections : _projection->intermediate_projections) {
270
5.86k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
5.86k
        }
272
246k
    }
273
660k
    if (_child && !is_source()) {
274
101k
        RETURN_IF_ERROR(_child->prepare(state));
275
101k
    }
276
277
660k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
660k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
660k
    return Status::OK();
283
660k
}
284
285
6.39k
Status OperatorXBase::terminate(RuntimeState* state) {
286
6.39k
    if (_child && !is_source()) {
287
719
        RETURN_IF_ERROR(_child->terminate(state));
288
719
    }
289
6.39k
    auto result = state->get_local_state_result(operator_id());
290
6.39k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
6.39k
    return result.value()->terminate(state);
294
6.39k
}
295
296
4.81M
Status OperatorXBase::close(RuntimeState* state) {
297
4.81M
    if (_child && !is_source()) {
298
816k
        RETURN_IF_ERROR(_child->close(state));
299
816k
    }
300
4.81M
    auto result = state->get_local_state_result(operator_id());
301
4.81M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.81M
    return result.value()->close(state);
305
4.81M
}
306
307
264k
void PipelineXLocalStateBase::clear_origin_block() {
308
264k
    _origin_block.clear_column_data(
309
264k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
264k
}
311
312
796k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
796k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
796k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
796k
    return Status::OK();
317
796k
}
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
264k
                                     Block* output_block) const {
326
264k
    auto* local_state = state->get_local_state(operator_id());
327
264k
    SCOPED_TIMER(local_state->exec_time_counter());
328
264k
    SCOPED_TIMER(local_state->_projection_timer);
329
264k
    const size_t rows = origin_block->rows();
330
264k
    if (rows == 0) {
331
142k
        return Status::OK();
332
142k
    }
333
122k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
122k
    {
336
122k
        Block input_block = *origin_block;
337
338
122k
        ColumnsWithTypeAndName new_columns;
339
122k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.68k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.68k
            new_columns.resize(projections.size());
345
66.6k
            for (int i = 0; i < projections.size(); i++) {
346
62.9k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
62.9k
                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
62.9k
            }
355
3.68k
            Block tmp_block {new_columns};
356
3.68k
            input_block.swap(tmp_block);
357
3.68k
        }
358
359
122k
        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
122k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
122k
                output_block, _projection->output_row_descriptor);
368
122k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
122k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
122k
        Columns shared_columns(mutable_columns.size());
371
372
716k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
594k
            ColumnPtr column_ptr;
374
594k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
594k
            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
594k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
594k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
594k
            if (column_ptr->is_exclusive()) {
386
223k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
371k
            } else {
388
371k
                shared_columns[i] = std::move(column_ptr);
389
371k
            }
390
594k
        }
391
392
122k
        scoped_mutable_block.restore();
393
716k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
594k
            if (shared_columns[i]) {
395
371k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
371k
            }
397
594k
        }
398
122k
    }
399
400
0
    origin_block->clear_column_data(
401
122k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
122k
    DCHECK_EQ(output_block->rows(), rows);
403
404
122k
    return Status::OK();
405
122k
}
406
407
4.42M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.42M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.42M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.42M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.42M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.42M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.42M
            if (_debug_point_count++ % 2 == 0) {
414
4.42M
                return Status::OK();
415
4.42M
            }
416
4.42M
        }
417
4.42M
    });
418
419
4.42M
    Status status;
420
4.42M
    auto* local_state = state->get_local_state(operator_id());
421
4.42M
    Defer defer([&]() {
422
4.42M
        if (status.ok()) {
423
4.42M
            local_state->update_output_block_counters(*block);
424
4.42M
        }
425
4.42M
    });
426
4.42M
    if (has_projection()) {
427
264k
        local_state->clear_origin_block();
428
264k
        status = get_block(state, &local_state->_origin_block, eos);
429
264k
        if (UNLIKELY(!status.ok())) {
430
25
            return status;
431
25
        }
432
264k
        status = do_projections(state, &local_state->_origin_block, block);
433
264k
        return status;
434
264k
    }
435
4.15M
    status = get_block(state, block, eos);
436
4.15M
    RETURN_IF_ERROR(block->check_type_and_column());
437
4.15M
    return status;
438
4.15M
}
439
440
2.68M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.68M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
4.47k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
4.47k
        *eos = true;
444
4.47k
    }
445
446
2.68M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.68M
        auto op_name = to_lower(_parent->_op_name);
448
2.68M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.68M
        arg_op_name = to_lower(arg_op_name);
450
451
2.68M
        if (op_name == arg_op_name) {
452
2.68M
            *eos = true;
453
2.68M
        }
454
2.68M
    });
455
456
2.68M
    if (auto rows = block->rows()) {
457
695k
        _num_rows_returned += rows;
458
695k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
695k
    }
460
2.68M
}
461
462
29.6k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
29.6k
    auto result = state->get_sink_local_state_result();
464
29.6k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
29.6k
    return result.value()->terminate(state);
468
29.6k
}
469
470
19.2k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
19.2k
    fmt::memory_buffer debug_string_buffer;
472
473
19.2k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
19.2k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
19.2k
    return fmt::to_string(debug_string_buffer);
476
19.2k
}
477
478
19.2k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
19.2k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
19.2k
}
481
482
327k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
327k
    std::string op_name = "UNKNOWN_SINK";
484
327k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
328k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
328k
        op_name = it->second;
488
328k
    }
489
327k
    _name = op_name + "_OPERATOR";
490
327k
    return Status::OK();
491
327k
}
492
493
277k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
277k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
277k
    _nereids_id = tnode.nereids_id;
496
277k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
277k
    _name = substr + "_SINK_OPERATOR";
498
277k
    return Status::OK();
499
277k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.68M
                                                            LocalSinkStateInfo& info) {
504
1.68M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.68M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.68M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.68M
    return Status::OK();
508
1.68M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
116k
                                                            LocalSinkStateInfo& info) {
504
116k
    auto local_state = LocalStateType::create_unique(this, state);
505
116k
    RETURN_IF_ERROR(local_state->init(state, info));
506
116k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
116k
    return Status::OK();
508
116k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
379k
                                                            LocalSinkStateInfo& info) {
504
379k
    auto local_state = LocalStateType::create_unique(this, state);
505
379k
    RETURN_IF_ERROR(local_state->init(state, info));
506
379k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
379k
    return Status::OK();
508
379k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
3
                                                            LocalSinkStateInfo& info) {
504
3
    auto local_state = LocalStateType::create_unique(this, state);
505
3
    RETURN_IF_ERROR(local_state->init(state, info));
506
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
3
    return Status::OK();
508
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
357
                                                            LocalSinkStateInfo& info) {
504
357
    auto local_state = LocalStateType::create_unique(this, state);
505
357
    RETURN_IF_ERROR(local_state->init(state, info));
506
357
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
357
    return Status::OK();
508
357
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
44.7k
                                                            LocalSinkStateInfo& info) {
504
44.7k
    auto local_state = LocalStateType::create_unique(this, state);
505
44.7k
    RETURN_IF_ERROR(local_state->init(state, info));
506
44.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
44.7k
    return Status::OK();
508
44.7k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
60
                                                            LocalSinkStateInfo& info) {
504
60
    auto local_state = LocalStateType::create_unique(this, state);
505
60
    RETURN_IF_ERROR(local_state->init(state, info));
506
60
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
60
    return Status::OK();
508
60
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7.15k
                                                            LocalSinkStateInfo& info) {
504
7.15k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.15k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.15k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.15k
    return Status::OK();
508
7.15k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6
                                                            LocalSinkStateInfo& info) {
504
6
    auto local_state = LocalStateType::create_unique(this, state);
505
6
    RETURN_IF_ERROR(local_state->init(state, info));
506
6
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6
    return Status::OK();
508
6
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
209k
                                                            LocalSinkStateInfo& info) {
504
209k
    auto local_state = LocalStateType::create_unique(this, state);
505
209k
    RETURN_IF_ERROR(local_state->init(state, info));
506
209k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
209k
    return Status::OK();
508
209k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
33
                                                            LocalSinkStateInfo& info) {
504
33
    auto local_state = LocalStateType::create_unique(this, state);
505
33
    RETURN_IF_ERROR(local_state->init(state, info));
506
33
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
33
    return Status::OK();
508
33
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
235k
                                                            LocalSinkStateInfo& info) {
504
235k
    auto local_state = LocalStateType::create_unique(this, state);
505
235k
    RETURN_IF_ERROR(local_state->init(state, info));
506
235k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
235k
    return Status::OK();
508
235k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
88.0k
                                                            LocalSinkStateInfo& info) {
504
88.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
88.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
88.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
88.0k
    return Status::OK();
508
88.0k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
76.6k
                                                            LocalSinkStateInfo& info) {
504
76.6k
    auto local_state = LocalStateType::create_unique(this, state);
505
76.6k
    RETURN_IF_ERROR(local_state->init(state, info));
506
76.6k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
76.6k
    return Status::OK();
508
76.6k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
210
                                                            LocalSinkStateInfo& info) {
504
210
    auto local_state = LocalStateType::create_unique(this, state);
505
210
    RETURN_IF_ERROR(local_state->init(state, info));
506
210
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
210
    return Status::OK();
508
210
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
499k
                                                            LocalSinkStateInfo& info) {
504
499k
    auto local_state = LocalStateType::create_unique(this, state);
505
499k
    RETURN_IF_ERROR(local_state->init(state, info));
506
499k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
499k
    return Status::OK();
508
499k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.75k
                                                            LocalSinkStateInfo& info) {
504
6.75k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.75k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.75k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.75k
    return Status::OK();
508
6.75k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7.86k
                                                            LocalSinkStateInfo& info) {
504
7.86k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.86k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.86k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.86k
    return Status::OK();
508
7.86k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_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_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
344
                                                            LocalSinkStateInfo& info) {
504
344
    auto local_state = LocalStateType::create_unique(this, state);
505
344
    RETURN_IF_ERROR(local_state->init(state, info));
506
344
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
344
    return Status::OK();
508
344
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.75k
                                                            LocalSinkStateInfo& info) {
504
4.75k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.75k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.75k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.75k
    return Status::OK();
508
4.75k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_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_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.58k
                                                            LocalSinkStateInfo& info) {
504
2.58k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.58k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.58k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.58k
    return Status::OK();
508
2.58k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.47k
                                                            LocalSinkStateInfo& info) {
504
2.47k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.47k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.47k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.47k
    return Status::OK();
508
2.47k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
562
                                                            LocalSinkStateInfo& info) {
504
562
    auto local_state = LocalStateType::create_unique(this, state);
505
562
    RETURN_IF_ERROR(local_state->init(state, info));
506
562
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
562
    return Status::OK();
508
562
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
102
                                                            LocalSinkStateInfo& info) {
504
102
    auto local_state = LocalStateType::create_unique(this, state);
505
102
    RETURN_IF_ERROR(local_state->init(state, info));
506
102
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
102
    return Status::OK();
508
102
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
164
                                                            LocalSinkStateInfo& info) {
504
164
    auto local_state = LocalStateType::create_unique(this, state);
505
164
    RETURN_IF_ERROR(local_state->init(state, info));
506
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
164
    return Status::OK();
508
164
}
509
510
template <typename LocalStateType>
511
1.34M
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.34M
    } else {
519
1.34M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.34M
        ss->id = operator_id();
521
1.34M
        for (auto& dest : dests_id()) {
522
1.33M
            ss->related_op_ids.insert(dest);
523
1.33M
        }
524
1.34M
        return ss;
525
1.34M
    }
526
1.34M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
103k
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
103k
    } else {
519
103k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
103k
        ss->id = operator_id();
521
103k
        for (auto& dest : dests_id()) {
522
102k
            ss->related_op_ids.insert(dest);
523
102k
        }
524
103k
        return ss;
525
103k
    }
526
103k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
378k
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
378k
    } else {
519
378k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
378k
        ss->id = operator_id();
521
378k
        for (auto& dest : dests_id()) {
522
374k
            ss->related_op_ids.insert(dest);
523
374k
        }
524
378k
        return ss;
525
378k
    }
526
378k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
3
    } else {
519
3
        auto ss = LocalStateType::SharedStateType::create_shared();
520
3
        ss->id = operator_id();
521
3
        for (auto& dest : dests_id()) {
522
3
            ss->related_op_ids.insert(dest);
523
3
        }
524
3
        return ss;
525
3
    }
526
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
357
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
357
    } else {
519
357
        auto ss = LocalStateType::SharedStateType::create_shared();
520
357
        ss->id = operator_id();
521
357
        for (auto& dest : dests_id()) {
522
353
            ss->related_op_ids.insert(dest);
523
353
        }
524
357
        return ss;
525
357
    }
526
357
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
44.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
44.7k
    } else {
519
44.7k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
44.7k
        ss->id = operator_id();
521
44.7k
        for (auto& dest : dests_id()) {
522
44.3k
            ss->related_op_ids.insert(dest);
523
44.3k
        }
524
44.7k
        return ss;
525
44.7k
    }
526
44.7k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
60
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
60
    } else {
519
60
        auto ss = LocalStateType::SharedStateType::create_shared();
520
60
        ss->id = operator_id();
521
60
        for (auto& dest : dests_id()) {
522
60
            ss->related_op_ids.insert(dest);
523
60
        }
524
60
        return ss;
525
60
    }
526
60
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
7.17k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
7.17k
    } else {
519
7.17k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7.17k
        ss->id = operator_id();
521
7.17k
        for (auto& dest : dests_id()) {
522
7.16k
            ss->related_op_ids.insert(dest);
523
7.16k
        }
524
7.17k
        return ss;
525
7.17k
    }
526
7.17k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6
    } else {
519
6
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6
        ss->id = operator_id();
521
6
        for (auto& dest : dests_id()) {
522
6
            ss->related_op_ids.insert(dest);
523
6
        }
524
6
        return ss;
525
6
    }
526
6
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
209k
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
209k
    } else {
519
209k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
209k
        ss->id = operator_id();
521
209k
        for (auto& dest : dests_id()) {
522
209k
            ss->related_op_ids.insert(dest);
523
209k
        }
524
209k
        return ss;
525
209k
    }
526
209k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
34
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
34
    } else {
519
34
        auto ss = LocalStateType::SharedStateType::create_shared();
520
34
        ss->id = operator_id();
521
34
        for (auto& dest : dests_id()) {
522
34
            ss->related_op_ids.insert(dest);
523
34
        }
524
34
        return ss;
525
34
    }
526
34
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
88.2k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
88.2k
    } else {
519
88.2k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
88.2k
        ss->id = operator_id();
521
88.2k
        for (auto& dest : dests_id()) {
522
88.1k
            ss->related_op_ids.insert(dest);
523
88.1k
        }
524
88.2k
        return ss;
525
88.2k
    }
526
88.2k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
209
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
209
    } else {
519
209
        auto ss = LocalStateType::SharedStateType::create_shared();
520
209
        ss->id = operator_id();
521
209
        for (auto& dest : dests_id()) {
522
209
            ss->related_op_ids.insert(dest);
523
209
        }
524
209
        return ss;
525
209
    }
526
209
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
499k
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
499k
    } else {
519
499k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
499k
        ss->id = operator_id();
521
499k
        for (auto& dest : dests_id()) {
522
491k
            ss->related_op_ids.insert(dest);
523
491k
        }
524
499k
        return ss;
525
499k
    }
526
499k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.75k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6.75k
    } else {
519
6.75k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.75k
        ss->id = operator_id();
521
6.75k
        for (auto& dest : dests_id()) {
522
6.75k
            ss->related_op_ids.insert(dest);
523
6.75k
        }
524
6.75k
        return ss;
525
6.75k
    }
526
6.75k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
446
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
446
    } else {
519
446
        auto ss = LocalStateType::SharedStateType::create_shared();
520
446
        ss->id = operator_id();
521
446
        for (auto& dest : dests_id()) {
522
446
            ss->related_op_ids.insert(dest);
523
446
        }
524
446
        return ss;
525
446
    }
526
446
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.58k
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.58k
    } else {
519
2.58k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.58k
        ss->id = operator_id();
521
2.58k
        for (auto& dest : dests_id()) {
522
2.58k
            ss->related_op_ids.insert(dest);
523
2.58k
        }
524
2.58k
        return ss;
525
2.58k
    }
526
2.58k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.47k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.47k
    } else {
519
2.47k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.47k
        ss->id = operator_id();
521
2.47k
        for (auto& dest : dests_id()) {
522
2.46k
            ss->related_op_ids.insert(dest);
523
2.46k
        }
524
2.47k
        return ss;
525
2.47k
    }
526
2.47k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
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
562
            ss->related_op_ids.insert(dest);
523
562
        }
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
2.02M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.02M
    auto local_state = LocalStateType::create_unique(state, this);
531
2.02M
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.02M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.02M
    return Status::OK();
534
2.02M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
68.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
68.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
68.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
68.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
68.0k
    return Status::OK();
534
68.0k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
235k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
235k
    auto local_state = LocalStateType::create_unique(state, this);
531
235k
    RETURN_IF_ERROR(local_state->init(state, info));
532
235k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
235k
    return Status::OK();
534
235k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
159
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
159
    auto local_state = LocalStateType::create_unique(state, this);
531
159
    RETURN_IF_ERROR(local_state->init(state, info));
532
159
    state->emplace_local_state(operator_id(), std::move(local_state));
533
159
    return Status::OK();
534
159
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.14k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.14k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.14k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.14k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.14k
    return Status::OK();
534
7.14k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.01k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.01k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.01k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.01k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.01k
    return Status::OK();
534
7.01k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
26
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
26
    auto local_state = LocalStateType::create_unique(state, this);
531
26
    RETURN_IF_ERROR(local_state->init(state, info));
532
26
    state->emplace_local_state(operator_id(), std::move(local_state));
533
26
    return Status::OK();
534
26
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
201k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
201k
    auto local_state = LocalStateType::create_unique(state, this);
531
201k
    RETURN_IF_ERROR(local_state->init(state, info));
532
201k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
201k
    return Status::OK();
534
201k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
87.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
87.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
87.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
87.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
87.8k
    return Status::OK();
534
87.8k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
77.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
77.2k
    auto local_state = LocalStateType::create_unique(state, this);
531
77.2k
    RETURN_IF_ERROR(local_state->init(state, info));
532
77.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
77.2k
    return Status::OK();
534
77.2k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
200
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
200
    auto local_state = LocalStateType::create_unique(state, this);
531
200
    RETURN_IF_ERROR(local_state->init(state, info));
532
200
    state->emplace_local_state(operator_id(), std::move(local_state));
533
200
    return Status::OK();
534
200
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.57k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.57k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.57k
    return Status::OK();
534
5.57k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
283k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
283k
    auto local_state = LocalStateType::create_unique(state, this);
531
283k
    RETURN_IF_ERROR(local_state->init(state, info));
532
283k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
283k
    return Status::OK();
534
283k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.29k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.29k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.29k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.29k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.29k
    return Status::OK();
534
1.29k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.68k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.68k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.68k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.68k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.68k
    return Status::OK();
534
6.68k
}
_ZN5doris9OperatorXINS_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.59k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.59k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.59k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.59k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.59k
    return Status::OK();
534
1.59k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
53.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
53.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
53.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
53.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
53.0k
    return Status::OK();
534
53.0k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.22k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.22k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.22k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.22k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.22k
    return Status::OK();
534
6.22k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
344
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
344
    auto local_state = LocalStateType::create_unique(state, this);
531
344
    RETURN_IF_ERROR(local_state->init(state, info));
532
344
    state->emplace_local_state(operator_id(), std::move(local_state));
533
344
    return Status::OK();
534
344
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.60k
    return Status::OK();
534
2.60k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.48k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.48k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.48k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.48k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.48k
    return Status::OK();
534
2.48k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
293
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
293
    auto local_state = LocalStateType::create_unique(state, this);
531
293
    RETURN_IF_ERROR(local_state->init(state, info));
532
293
    state->emplace_local_state(operator_id(), std::move(local_state));
533
293
    return Status::OK();
534
293
}
_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.26k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.26k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.26k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.26k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.26k
    return Status::OK();
534
5.26k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
638k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
638k
    auto local_state = LocalStateType::create_unique(state, this);
531
638k
    RETURN_IF_ERROR(local_state->init(state, info));
532
638k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
638k
    return Status::OK();
534
638k
}
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
1.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.00k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.00k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.00k
    return Status::OK();
534
1.00k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.29k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.29k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.29k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.29k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.29k
    return Status::OK();
534
6.29k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
316k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
316k
    auto local_state = LocalStateType::create_unique(state, this);
531
316k
    RETURN_IF_ERROR(local_state->init(state, info));
532
316k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
316k
    return Status::OK();
534
316k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.67M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
2.00M
        : _num_rows_returned(0),
542
2.00M
          _rows_returned_counter(nullptr),
543
2.00M
          _parent(parent),
544
2.00M
          _state(state),
545
2.00M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
2.02M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
2.02M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
2.02M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
2.02M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
2.02M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
2.02M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
2.02M
    _operator_profile->add_child(_common_profile.get(), true);
557
2.02M
    _operator_profile->add_child(_custom_profile.get(), true);
558
2.02M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
2.02M
    if constexpr (!is_fake_shared) {
560
1.16M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
724k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
724k
                                    .first.get()
563
724k
                                    ->template cast<SharedStateArg>();
564
565
724k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
724k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
724k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
724k
        } else if (info.shared_state) {
569
372k
            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
372k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
372k
            _dependency = _shared_state->create_source_dependency(
576
372k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
372k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
372k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
372k
        } else {
580
65.1k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
6.64k
                DCHECK(false);
582
6.64k
            }
583
65.1k
        }
584
1.16M
    }
585
586
2.02M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
2.02M
    _rows_returned_counter =
591
2.02M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
2.02M
    _blocks_returned_counter =
593
2.02M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
2.02M
    _output_block_bytes_counter =
595
2.02M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
2.02M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
2.02M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
2.02M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
2.02M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
2.02M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
2.02M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
2.02M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
2.02M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
2.02M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
2.02M
    _memory_used_counter =
606
2.02M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
2.02M
    _common_profile->add_info_string("IsColocate",
608
2.02M
                                     std::to_string(_parent->is_colocated_operator()));
609
2.02M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
2.02M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
2.02M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
2.02M
    return Status::OK();
613
2.02M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
68.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
68.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
68.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
68.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
68.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
68.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
68.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
68.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
68.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
68.0k
    if constexpr (!is_fake_shared) {
560
68.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
13.1k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
13.1k
                                    .first.get()
563
13.1k
                                    ->template cast<SharedStateArg>();
564
565
13.1k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
13.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
13.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.8k
        } 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
53.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
53.9k
            _dependency = _shared_state->create_source_dependency(
576
53.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
53.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
53.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
53.9k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
967
        }
584
68.0k
    }
585
586
68.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
68.0k
    _rows_returned_counter =
591
68.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
68.0k
    _blocks_returned_counter =
593
68.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
68.0k
    _output_block_bytes_counter =
595
68.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
68.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
68.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
68.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
68.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
68.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
68.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
68.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
68.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
68.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
68.0k
    _memory_used_counter =
606
68.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
68.0k
    _common_profile->add_info_string("IsColocate",
608
68.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
68.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
68.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
68.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
68.0k
    return Status::OK();
613
68.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1
    _operator_profile->add_child(_common_profile.get(), true);
557
1
    _operator_profile->add_child(_custom_profile.get(), true);
558
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1
    if constexpr (!is_fake_shared) {
560
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
1
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1
            _dependency = _shared_state->create_source_dependency(
576
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
1
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
1
    }
585
586
1
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1
    _rows_returned_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1
    _blocks_returned_counter =
593
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1
    _output_block_bytes_counter =
595
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1
    _memory_used_counter =
606
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1
    _common_profile->add_info_string("IsColocate",
608
1
                                     std::to_string(_parent->is_colocated_operator()));
609
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1
    return Status::OK();
613
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
209k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
209k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
209k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
209k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
209k
    _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
209k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
209k
    _operator_profile->add_child(_common_profile.get(), true);
557
209k
    _operator_profile->add_child(_custom_profile.get(), true);
558
209k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
209k
    if constexpr (!is_fake_shared) {
560
209k
        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
209k
        } 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
203k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
203k
            _dependency = _shared_state->create_source_dependency(
576
203k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
203k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
203k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
203k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
5.97k
        }
584
209k
    }
585
586
209k
    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
209k
    _rows_returned_counter =
591
209k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
209k
    _blocks_returned_counter =
593
209k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
209k
    _output_block_bytes_counter =
595
209k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
209k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
209k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
209k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
209k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
209k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
209k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
209k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
209k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
209k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
209k
    _memory_used_counter =
606
209k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
209k
    _common_profile->add_info_string("IsColocate",
608
209k
                                     std::to_string(_parent->is_colocated_operator()));
609
209k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
209k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
209k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
209k
    return Status::OK();
613
209k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_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_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.70k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.70k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.70k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.70k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.70k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.70k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.70k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.70k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.70k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.70k
    if constexpr (!is_fake_shared) {
560
6.70k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.70k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.57k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.57k
            _dependency = _shared_state->create_source_dependency(
576
6.57k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.57k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.57k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.57k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
123
        }
584
6.70k
    }
585
586
6.70k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.70k
    _rows_returned_counter =
591
6.70k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.70k
    _blocks_returned_counter =
593
6.70k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.70k
    _output_block_bytes_counter =
595
6.70k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.70k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.70k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.70k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.70k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.70k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.70k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.70k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.70k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.70k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.70k
    _memory_used_counter =
606
6.70k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.70k
    _common_profile->add_info_string("IsColocate",
608
6.70k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.70k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.70k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.70k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.70k
    return Status::OK();
613
6.70k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
7.17k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
7.17k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
7.17k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
7.17k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
7.17k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
7.17k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
7.17k
    _operator_profile->add_child(_common_profile.get(), true);
557
7.17k
    _operator_profile->add_child(_custom_profile.get(), true);
558
7.17k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
7.17k
    if constexpr (!is_fake_shared) {
560
7.17k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
7.17k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
7.11k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
7.11k
            _dependency = _shared_state->create_source_dependency(
576
7.11k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
7.11k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
7.11k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
7.11k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
55
        }
584
7.17k
    }
585
586
7.17k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
7.17k
    _rows_returned_counter =
591
7.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
7.17k
    _blocks_returned_counter =
593
7.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
7.17k
    _output_block_bytes_counter =
595
7.17k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.17k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
7.17k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
7.17k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
7.17k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
7.17k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
7.17k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
7.17k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
7.17k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
7.17k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
7.17k
    _memory_used_counter =
606
7.17k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
7.17k
    _common_profile->add_info_string("IsColocate",
608
7.17k
                                     std::to_string(_parent->is_colocated_operator()));
609
7.17k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
7.17k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
7.17k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
7.17k
    return Status::OK();
613
7.17k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
88.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
88.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
88.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
88.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
88.2k
    _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
88.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
88.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
88.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
88.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
88.2k
    if constexpr (!is_fake_shared) {
560
88.2k
        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
88.2k
        } 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
86.5k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
86.5k
            _dependency = _shared_state->create_source_dependency(
576
86.5k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
86.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
86.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
86.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.68k
        }
584
88.2k
    }
585
586
88.2k
    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
88.2k
    _rows_returned_counter =
591
88.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
88.2k
    _blocks_returned_counter =
593
88.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
88.2k
    _output_block_bytes_counter =
595
88.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
88.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
88.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
88.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
88.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
88.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
88.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
88.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
88.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
88.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
88.2k
    _memory_used_counter =
606
88.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
88.2k
    _common_profile->add_info_string("IsColocate",
608
88.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
88.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
88.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
88.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
88.2k
    return Status::OK();
613
88.2k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
77.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
77.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
77.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
77.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
77.2k
    _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
77.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
77.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
77.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
77.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
77.2k
    if constexpr (!is_fake_shared) {
560
77.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
77.2k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
77.2k
                                    .first.get()
563
77.2k
                                    ->template cast<SharedStateArg>();
564
565
77.2k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
77.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
77.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
77.2k
        } 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
17
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
17
        }
584
77.2k
    }
585
586
77.2k
    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
77.2k
    _rows_returned_counter =
591
77.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
77.2k
    _blocks_returned_counter =
593
77.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
77.2k
    _output_block_bytes_counter =
595
77.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
77.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
77.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
77.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
77.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
77.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
77.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
77.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
77.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
77.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
77.2k
    _memory_used_counter =
606
77.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
77.2k
    _common_profile->add_info_string("IsColocate",
608
77.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
77.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
77.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
77.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
77.2k
    return Status::OK();
613
77.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
200
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
200
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
200
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
200
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
200
    _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
200
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
200
    _operator_profile->add_child(_common_profile.get(), true);
557
200
    _operator_profile->add_child(_custom_profile.get(), true);
558
200
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
200
    if constexpr (!is_fake_shared) {
560
200
        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
200
        } 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
200
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
200
            _dependency = _shared_state->create_source_dependency(
576
200
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
200
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
200
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
200
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
200
    }
585
586
200
    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
200
    _rows_returned_counter =
591
200
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
200
    _blocks_returned_counter =
593
200
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
200
    _output_block_bytes_counter =
595
200
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
200
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
200
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
200
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
200
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
200
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
200
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
200
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
200
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
200
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
200
    _memory_used_counter =
606
200
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
200
    _common_profile->add_info_string("IsColocate",
608
200
                                     std::to_string(_parent->is_colocated_operator()));
609
200
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
200
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
200
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
200
    return Status::OK();
613
200
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
860k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
860k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
860k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
860k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
860k
    _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
860k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
860k
    _operator_profile->add_child(_common_profile.get(), true);
557
860k
    _operator_profile->add_child(_custom_profile.get(), true);
558
860k
    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
860k
    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
860k
    _rows_returned_counter =
591
860k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
860k
    _blocks_returned_counter =
593
860k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
860k
    _output_block_bytes_counter =
595
860k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
860k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
860k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
860k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
860k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
860k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
860k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
860k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
860k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
860k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
860k
    _memory_used_counter =
606
860k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
860k
    _common_profile->add_info_string("IsColocate",
608
860k
                                     std::to_string(_parent->is_colocated_operator()));
609
860k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
860k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
860k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
860k
    return Status::OK();
613
860k
}
_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.51k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
3.51k
            _dependency = _shared_state->create_source_dependency(
576
3.51k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
3.51k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
3.51k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
49.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
49.5k
        }
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
6.24k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.24k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.24k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.24k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.24k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.24k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.24k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.24k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.24k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.24k
    if constexpr (!is_fake_shared) {
560
6.24k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.24k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.18k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.18k
            _dependency = _shared_state->create_source_dependency(
576
6.18k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.18k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.18k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.18k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
64
        }
584
6.24k
    }
585
586
6.24k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.24k
    _rows_returned_counter =
591
6.24k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.24k
    _blocks_returned_counter =
593
6.24k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.24k
    _output_block_bytes_counter =
595
6.24k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.24k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.24k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.24k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.24k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.24k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.24k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.24k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.24k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.24k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.24k
    _memory_used_counter =
606
6.24k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.24k
    _common_profile->add_info_string("IsColocate",
608
6.24k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.24k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.24k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.24k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.24k
    return Status::OK();
613
6.24k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
446
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
446
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
446
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
446
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
446
    _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
446
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
446
    _operator_profile->add_child(_common_profile.get(), true);
557
446
    _operator_profile->add_child(_custom_profile.get(), true);
558
446
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
446
    if constexpr (!is_fake_shared) {
560
446
        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
446
        } 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
445
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
445
            _dependency = _shared_state->create_source_dependency(
576
445
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
445
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
445
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
445
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
446
    }
585
586
446
    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
446
    _rows_returned_counter =
591
446
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
446
    _blocks_returned_counter =
593
446
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
446
    _output_block_bytes_counter =
595
446
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
446
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
446
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
446
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
446
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
446
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
446
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
446
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
446
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
446
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
446
    _memory_used_counter =
606
446
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
446
    _common_profile->add_info_string("IsColocate",
608
446
                                     std::to_string(_parent->is_colocated_operator()));
609
446
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
446
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
446
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
446
    return Status::OK();
613
446
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.11k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.11k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.11k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.11k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.11k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.11k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.11k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.11k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.11k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.11k
    if constexpr (!is_fake_shared) {
560
5.11k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.11k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.06k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.06k
            _dependency = _shared_state->create_source_dependency(
576
5.06k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.06k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.06k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.06k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
55
        }
584
5.11k
    }
585
586
5.11k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.11k
    _rows_returned_counter =
591
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.11k
    _blocks_returned_counter =
593
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.11k
    _output_block_bytes_counter =
595
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.11k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.11k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.11k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.11k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.11k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.11k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.11k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.11k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.11k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.11k
    _memory_used_counter =
606
5.11k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.11k
    _common_profile->add_info_string("IsColocate",
608
5.11k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.11k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.11k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.11k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.11k
    return Status::OK();
613
5.11k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
640k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
640k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
640k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
640k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
640k
    _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
640k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
640k
    _operator_profile->add_child(_common_profile.get(), true);
557
640k
    _operator_profile->add_child(_custom_profile.get(), true);
558
640k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
640k
    if constexpr (!is_fake_shared) {
560
640k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
633k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
633k
                                    .first.get()
563
633k
                                    ->template cast<SharedStateArg>();
564
565
633k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
633k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
633k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
633k
        } else if (info.shared_state) {
569
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.64k
        } else {
580
6.64k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
6.64k
                DCHECK(false);
582
6.64k
            }
583
6.64k
        }
584
640k
    }
585
586
640k
    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
640k
    _rows_returned_counter =
591
640k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
640k
    _blocks_returned_counter =
593
640k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
640k
    _output_block_bytes_counter =
595
640k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
640k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
640k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
640k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
640k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
640k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
640k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
640k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
640k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
640k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
640k
    _memory_used_counter =
606
640k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
640k
    _common_profile->add_info_string("IsColocate",
608
640k
                                     std::to_string(_parent->is_colocated_operator()));
609
640k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
640k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
640k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
640k
    return Status::OK();
613
640k
}
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
2.03M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.03M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.33M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
294k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
294k
    }
621
2.03M
    if (_parent->has_projection()) {
622
360k
        const auto& projection = *_parent->_projection;
623
360k
        _projections.resize(projection.projections.size());
624
2.25M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.89M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.89M
        }
627
360k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
372k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
11.8k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
187k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
175k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
175k
                        state, _intermediate_projections[i][j]));
633
175k
            }
634
11.8k
        }
635
360k
    }
636
2.03M
    return Status::OK();
637
2.03M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
68.5k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
68.5k
    _conjuncts.resize(_parent->_conjuncts.size());
618
70.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.53k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.53k
    }
621
68.5k
    if (_parent->has_projection()) {
622
68.5k
        const auto& projection = *_parent->_projection;
623
68.5k
        _projections.resize(projection.projections.size());
624
370k
        for (size_t i = 0; i < _projections.size(); i++) {
625
302k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
302k
        }
627
68.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
74.9k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.42k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
152k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
146k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
146k
                        state, _intermediate_projections[i][j]));
633
146k
            }
634
6.42k
        }
635
68.5k
    }
636
68.5k
    return Status::OK();
637
68.5k
}
_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
210k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
210k
    _conjuncts.resize(_parent->_conjuncts.size());
618
210k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
210k
    if (_parent->has_projection()) {
622
79
        const auto& projection = *_parent->_projection;
623
79
        _projections.resize(projection.projections.size());
624
401
        for (size_t i = 0; i < _projections.size(); i++) {
625
322
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
322
        }
627
79
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
79
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
79
    }
636
210k
    return Status::OK();
637
210k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
26
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
26
    _conjuncts.resize(_parent->_conjuncts.size());
618
26
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
26
    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
26
    return Status::OK();
637
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.78k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.78k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.89k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
111
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
111
    }
621
6.78k
    if (_parent->has_projection()) {
622
6.78k
        const auto& projection = *_parent->_projection;
623
6.78k
        _projections.resize(projection.projections.size());
624
29.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
23.0k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
23.0k
        }
627
6.78k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.81k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
29
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
188
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
159
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
159
                        state, _intermediate_projections[i][j]));
633
159
            }
634
29
        }
635
6.78k
    }
636
6.78k
    return Status::OK();
637
6.78k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
7.18k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
7.18k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.97k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
792
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
792
    }
621
7.18k
    if (_parent->has_projection()) {
622
3.86k
        const auto& projection = *_parent->_projection;
623
3.86k
        _projections.resize(projection.projections.size());
624
15.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
11.9k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
11.9k
        }
627
3.86k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
3.95k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
92
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
698
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
606
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
606
                        state, _intermediate_projections[i][j]));
633
606
            }
634
92
        }
635
3.86k
    }
636
7.18k
    return Status::OK();
637
7.18k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
88.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
88.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
90.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.63k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.63k
    }
621
88.4k
    if (_parent->has_projection()) {
622
29.9k
        const auto& projection = *_parent->_projection;
623
29.9k
        _projections.resize(projection.projections.size());
624
269k
        for (size_t i = 0; i < _projections.size(); i++) {
625
239k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
239k
        }
627
29.9k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
30.0k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
167
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.08k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
916
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
916
                        state, _intermediate_projections[i][j]));
633
916
            }
634
167
        }
635
29.9k
    }
636
88.4k
    return Status::OK();
637
88.4k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
77.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
77.2k
    _conjuncts.resize(_parent->_conjuncts.size());
618
77.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
11
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
11
    }
621
77.2k
    if (_parent->has_projection()) {
622
114
        const auto& projection = *_parent->_projection;
623
114
        _projections.resize(projection.projections.size());
624
549
        for (size_t i = 0; i < _projections.size(); i++) {
625
435
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
435
        }
627
114
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
114
        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
114
    }
636
77.2k
    return Status::OK();
637
77.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
204
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
204
    _conjuncts.resize(_parent->_conjuncts.size());
618
204
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
204
    if (_parent->has_projection()) {
622
176
        const auto& projection = *_parent->_projection;
623
176
        _projections.resize(projection.projections.size());
624
528
        for (size_t i = 0; i < _projections.size(); i++) {
625
352
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
352
        }
627
176
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
176
        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
176
    }
636
204
    return Status::OK();
637
204
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
867k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
867k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.15M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
289k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
289k
    }
621
867k
    if (_parent->has_projection()) {
622
239k
        const auto& projection = *_parent->_projection;
623
239k
        _projections.resize(projection.projections.size());
624
1.45M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.21M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.21M
        }
627
239k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
244k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
4.98k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
29.2k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
24.2k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
24.2k
                        state, _intermediate_projections[i][j]));
633
24.2k
            }
634
4.98k
        }
635
239k
    }
636
867k
    return Status::OK();
637
867k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
53.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
53.2k
    _conjuncts.resize(_parent->_conjuncts.size());
618
53.2k
    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.2k
    if (_parent->has_projection()) {
622
11.3k
        const auto& projection = *_parent->_projection;
623
11.3k
        _projections.resize(projection.projections.size());
624
109k
        for (size_t i = 0; i < _projections.size(); i++) {
625
98.5k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
98.5k
        }
627
11.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
176
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3.38k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3.20k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3.20k
                        state, _intermediate_projections[i][j]));
633
3.20k
            }
634
176
        }
635
11.3k
    }
636
53.2k
    return Status::OK();
637
53.2k
}
_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
6.23k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.23k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.17k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
941
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
941
    }
621
6.23k
    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
6.23k
    return Status::OK();
637
6.23k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
446
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
446
    _conjuncts.resize(_parent->_conjuncts.size());
618
446
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
446
    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
446
    return Status::OK();
637
446
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.12k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.12k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.12k
    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.12k
    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.12k
    return Status::OK();
637
5.12k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
644k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
644k
    _conjuncts.resize(_parent->_conjuncts.size());
618
644k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
644k
    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
644k
    return Status::OK();
637
644k
}
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.40k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.40k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.40k
    _terminated = true;
645
6.40k
    return Status::OK();
646
6.40k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
336
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
336
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
336
    _terminated = true;
645
336
    return Status::OK();
646
336
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
31
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
31
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
31
    _terminated = true;
645
31
    return Status::OK();
646
31
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
29
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
29
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
29
    _terminated = true;
645
29
    return Status::OK();
646
29
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
14
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
14
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
14
    _terminated = true;
645
14
    return Status::OK();
646
14
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_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_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
75
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
75
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
75
    _terminated = true;
645
75
    return Status::OK();
646
75
}
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
10
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
10
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
10
    _terminated = true;
645
10
    return Status::OK();
646
10
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.19k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.19k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1.19k
    _terminated = true;
645
1.19k
    return Status::OK();
646
1.19k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
36
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
36
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
36
    _terminated = true;
645
36
    return Status::OK();
646
36
}
647
648
template <typename SharedStateArg>
649
2.27M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.27M
    if (_closed) {
651
239k
        return Status::OK();
652
239k
    }
653
2.03M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.16M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.16M
    }
656
2.03M
    _closed = true;
657
2.03M
    return Status::OK();
658
2.27M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
68.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
68.4k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
68.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
68.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
68.4k
    }
656
68.4k
    _closed = true;
657
68.4k
    return Status::OK();
658
68.4k
}
_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
417k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
417k
    if (_closed) {
651
209k
        return Status::OK();
652
209k
    }
653
208k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
208k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
208k
    }
656
208k
    _closed = true;
657
208k
    return Status::OK();
658
417k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
26
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
26
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
26
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
26
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
26
    }
656
26
    _closed = true;
657
26
    return Status::OK();
658
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.76k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.76k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.76k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.76k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.76k
    }
656
6.76k
    _closed = true;
657
6.76k
    return Status::OK();
658
6.76k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
14.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
14.4k
    if (_closed) {
651
7.28k
        return Status::OK();
652
7.28k
    }
653
7.15k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
7.15k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
7.15k
    }
656
7.15k
    _closed = true;
657
7.15k
    return Status::OK();
658
14.4k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
88.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
88.1k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
88.1k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
88.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
88.1k
    }
656
88.1k
    _closed = true;
657
88.1k
    return Status::OK();
658
88.1k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
76.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
76.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
76.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
76.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
76.6k
    }
656
76.6k
    _closed = true;
657
76.6k
    return Status::OK();
658
76.6k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
199
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
199
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
199
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
199
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
199
    }
656
199
    _closed = true;
657
199
    return Status::OK();
658
199
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
885k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
885k
    if (_closed) {
651
16.5k
        return Status::OK();
652
16.5k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
868k
    _closed = true;
657
868k
    return Status::OK();
658
885k
}
_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
6.22k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.22k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.22k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.22k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.22k
    }
656
6.22k
    _closed = true;
657
6.22k
    return Status::OK();
658
6.22k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
686
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
686
    if (_closed) {
651
344
        return Status::OK();
652
344
    }
653
342
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
342
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
342
    }
656
342
    _closed = true;
657
342
    return Status::OK();
658
686
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.5k
    if (_closed) {
651
5.44k
        return Status::OK();
652
5.44k
    }
653
5.11k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.11k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.11k
    }
656
5.11k
    _closed = true;
657
5.11k
    return Status::OK();
658
10.5k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
646k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
646k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
646k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
646k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
646k
    }
656
646k
    _closed = true;
657
646k
    return Status::OK();
658
646k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
325
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
325
    if (_closed) {
651
170
        return Status::OK();
652
170
    }
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
325
}
659
660
template <typename SharedState>
661
1.68M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.68M
    _operator_profile =
664
1.68M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.68M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.68M
    _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.68M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.68M
    _operator_profile->add_child(_common_profile, true);
673
1.68M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.68M
    _operator_profile->set_metadata(_parent->node_id());
676
1.68M
    _wait_for_finish_dependency_timer =
677
1.68M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.68M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.68M
    if constexpr (!is_fake_shared) {
680
1.18M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.18M
            info.shared_state_map.end()) {
682
326k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
235k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
235k
            }
685
326k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
326k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
326k
                                                  ? 0
688
326k
                                                  : info.task_idx]
689
326k
                                  .get();
690
326k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
861k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
861k
            _shared_state = info.shared_state->template cast<SharedState>();
696
861k
            _dependency = _shared_state->create_sink_dependency(
697
861k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
861k
        }
699
1.18M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.18M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.18M
    }
702
703
1.68M
    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.68M
    _rows_input_counter =
708
1.68M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.68M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.68M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.68M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.68M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.68M
    _memory_used_counter =
714
1.68M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.68M
    _common_profile->add_info_string("IsColocate",
716
1.68M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.68M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.68M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.68M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.68M
    return Status::OK();
721
1.68M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
116k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
116k
    _operator_profile =
664
116k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
116k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
116k
    _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
116k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
116k
    _operator_profile->add_child(_common_profile, true);
673
116k
    _operator_profile->add_child(_custom_profile, true);
674
675
116k
    _operator_profile->set_metadata(_parent->node_id());
676
116k
    _wait_for_finish_dependency_timer =
677
116k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
116k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
116k
    if constexpr (!is_fake_shared) {
680
116k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
116k
            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
13.2k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
13.2k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
13.2k
                                                  ? 0
688
13.2k
                                                  : info.task_idx]
689
13.2k
                                  .get();
690
13.2k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
102k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
102k
            _shared_state = info.shared_state->template cast<SharedState>();
696
102k
            _dependency = _shared_state->create_sink_dependency(
697
102k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
102k
        }
699
116k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
116k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
116k
    }
702
703
116k
    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
116k
    _rows_input_counter =
708
116k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
116k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
116k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
116k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
116k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
116k
    _memory_used_counter =
714
116k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
116k
    _common_profile->add_info_string("IsColocate",
716
116k
                                     std::to_string(_parent->is_colocated_operator()));
717
116k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
116k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
116k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
116k
    return Status::OK();
721
116k
}
_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
209k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
209k
    _operator_profile =
664
209k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
209k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
209k
    _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
209k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
209k
    _operator_profile->add_child(_common_profile, true);
673
209k
    _operator_profile->add_child(_custom_profile, true);
674
675
209k
    _operator_profile->set_metadata(_parent->node_id());
676
209k
    _wait_for_finish_dependency_timer =
677
209k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
209k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
209k
    if constexpr (!is_fake_shared) {
680
209k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
209k
            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
209k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
209k
            _shared_state = info.shared_state->template cast<SharedState>();
696
209k
            _dependency = _shared_state->create_sink_dependency(
697
209k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
209k
        }
699
209k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
209k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
209k
    }
702
703
209k
    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
209k
    _rows_input_counter =
708
209k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
209k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
209k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
209k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
209k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
209k
    _memory_used_counter =
714
209k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
209k
    _common_profile->add_info_string("IsColocate",
716
209k
                                     std::to_string(_parent->is_colocated_operator()));
717
209k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
209k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
209k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
209k
    return Status::OK();
721
209k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
33
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
33
    _operator_profile =
664
33
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
33
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
33
    _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
33
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
33
    _operator_profile->add_child(_common_profile, true);
673
33
    _operator_profile->add_child(_custom_profile, true);
674
675
33
    _operator_profile->set_metadata(_parent->node_id());
676
33
    _wait_for_finish_dependency_timer =
677
33
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
33
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
33
    if constexpr (!is_fake_shared) {
680
33
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
33
            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
33
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
33
            _shared_state = info.shared_state->template cast<SharedState>();
696
33
            _dependency = _shared_state->create_sink_dependency(
697
33
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
33
        }
699
33
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
33
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
33
    }
702
703
33
    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
33
    _rows_input_counter =
708
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
33
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
33
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
33
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
33
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
33
    _memory_used_counter =
714
33
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
33
    _common_profile->add_info_string("IsColocate",
716
33
                                     std::to_string(_parent->is_colocated_operator()));
717
33
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
33
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
33
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
33
    return Status::OK();
721
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.75k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.75k
    _operator_profile =
664
6.75k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.75k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.75k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
6.75k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.75k
    _operator_profile->add_child(_common_profile, true);
673
6.75k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.75k
    _operator_profile->set_metadata(_parent->node_id());
676
6.75k
    _wait_for_finish_dependency_timer =
677
6.75k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.75k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.75k
    if constexpr (!is_fake_shared) {
680
6.75k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.75k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
6.75k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.75k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.75k
            _dependency = _shared_state->create_sink_dependency(
697
6.75k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.75k
        }
699
6.75k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.75k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.75k
    }
702
703
6.75k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
6.75k
    _rows_input_counter =
708
6.75k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.75k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.75k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.75k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.75k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.75k
    _memory_used_counter =
714
6.75k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.75k
    _common_profile->add_info_string("IsColocate",
716
6.75k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.75k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.75k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.75k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.75k
    return Status::OK();
721
6.75k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.16k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.16k
    _operator_profile =
664
7.16k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.16k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.16k
    _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.16k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.16k
    _operator_profile->add_child(_common_profile, true);
673
7.16k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.16k
    _operator_profile->set_metadata(_parent->node_id());
676
7.16k
    _wait_for_finish_dependency_timer =
677
7.16k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.16k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.16k
    if constexpr (!is_fake_shared) {
680
7.16k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.16k
            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.16k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.16k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.16k
            _dependency = _shared_state->create_sink_dependency(
697
7.16k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.16k
        }
699
7.16k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.16k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.16k
    }
702
703
7.16k
    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.16k
    _rows_input_counter =
708
7.16k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.16k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.16k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.16k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.16k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.16k
    _memory_used_counter =
714
7.16k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.16k
    _common_profile->add_info_string("IsColocate",
716
7.16k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.16k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.16k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.16k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.16k
    return Status::OK();
721
7.16k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
88.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
88.1k
    _operator_profile =
664
88.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
88.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
88.1k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
88.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
88.1k
    _operator_profile->add_child(_common_profile, true);
673
88.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
88.1k
    _operator_profile->set_metadata(_parent->node_id());
676
88.1k
    _wait_for_finish_dependency_timer =
677
88.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
88.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
88.1k
    if constexpr (!is_fake_shared) {
680
88.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
88.1k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
88.1k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
88.1k
            _shared_state = info.shared_state->template cast<SharedState>();
696
88.1k
            _dependency = _shared_state->create_sink_dependency(
697
88.1k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
88.1k
        }
699
88.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
88.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
88.1k
    }
702
703
88.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
88.1k
    _rows_input_counter =
708
88.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
88.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
88.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
88.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
88.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
88.1k
    _memory_used_counter =
714
88.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
88.1k
    _common_profile->add_info_string("IsColocate",
716
88.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
88.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
88.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
88.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
88.1k
    return Status::OK();
721
88.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
77.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
77.0k
    _operator_profile =
664
77.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
77.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
77.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
77.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
77.0k
    _operator_profile->add_child(_common_profile, true);
673
77.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
77.0k
    _operator_profile->set_metadata(_parent->node_id());
676
77.0k
    _wait_for_finish_dependency_timer =
677
77.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
77.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
77.0k
    if constexpr (!is_fake_shared) {
680
77.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
77.2k
            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
77.2k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
77.2k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
77.2k
                                                  ? 0
688
77.2k
                                                  : info.task_idx]
689
77.2k
                                  .get();
690
77.2k
            _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
77.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
77.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
77.0k
    }
702
703
77.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
77.0k
    _rows_input_counter =
708
77.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
77.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
77.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
77.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
77.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
77.0k
    _memory_used_counter =
714
77.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
77.0k
    _common_profile->add_info_string("IsColocate",
716
77.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
77.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
77.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
77.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
77.0k
    return Status::OK();
721
77.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
210
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
210
    _operator_profile =
664
210
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
210
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
210
    _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
210
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
210
    _operator_profile->add_child(_common_profile, true);
673
210
    _operator_profile->add_child(_custom_profile, true);
674
675
210
    _operator_profile->set_metadata(_parent->node_id());
676
210
    _wait_for_finish_dependency_timer =
677
210
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
210
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
210
    if constexpr (!is_fake_shared) {
680
210
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
210
            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
210
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
210
            _shared_state = info.shared_state->template cast<SharedState>();
696
210
            _dependency = _shared_state->create_sink_dependency(
697
210
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
210
        }
699
210
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
210
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
210
    }
702
703
210
    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
210
    _rows_input_counter =
708
210
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
210
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
210
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
210
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
210
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
210
    _memory_used_counter =
714
210
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
210
    _common_profile->add_info_string("IsColocate",
716
210
                                     std::to_string(_parent->is_colocated_operator()));
717
210
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
210
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
210
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
210
    return Status::OK();
721
210
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
499k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
499k
    _operator_profile =
664
499k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
499k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
499k
    _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
499k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
499k
    _operator_profile->add_child(_common_profile, true);
673
499k
    _operator_profile->add_child(_custom_profile, true);
674
675
499k
    _operator_profile->set_metadata(_parent->node_id());
676
499k
    _wait_for_finish_dependency_timer =
677
499k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
499k
    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
499k
    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
499k
    _rows_input_counter =
708
499k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
499k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
499k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
499k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
499k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
499k
    _memory_used_counter =
714
499k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
499k
    _common_profile->add_info_string("IsColocate",
716
499k
                                     std::to_string(_parent->is_colocated_operator()));
717
499k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
499k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
499k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
499k
    return Status::OK();
721
499k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.87k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.87k
    _operator_profile =
664
7.87k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.87k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.87k
    _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.87k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.87k
    _operator_profile->add_child(_common_profile, true);
673
7.87k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.87k
    _operator_profile->set_metadata(_parent->node_id());
676
7.87k
    _wait_for_finish_dependency_timer =
677
7.87k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.87k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.87k
    if constexpr (!is_fake_shared) {
680
7.87k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.87k
            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.87k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.87k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.87k
            _dependency = _shared_state->create_sink_dependency(
697
7.87k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.87k
        }
699
7.87k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.87k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.87k
    }
702
703
7.87k
    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.87k
    _rows_input_counter =
708
7.87k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.87k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.87k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.87k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.87k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.87k
    _memory_used_counter =
714
7.87k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.87k
    _common_profile->add_info_string("IsColocate",
716
7.87k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.87k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.87k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.87k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.87k
    return Status::OK();
721
7.87k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
446
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
446
    _operator_profile =
664
446
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
446
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
446
    _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
446
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
446
    _operator_profile->add_child(_common_profile, true);
673
446
    _operator_profile->add_child(_custom_profile, true);
674
675
446
    _operator_profile->set_metadata(_parent->node_id());
676
446
    _wait_for_finish_dependency_timer =
677
446
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
446
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
446
    if constexpr (!is_fake_shared) {
680
446
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
446
            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
446
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
446
            _shared_state = info.shared_state->template cast<SharedState>();
696
446
            _dependency = _shared_state->create_sink_dependency(
697
446
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
446
        }
699
446
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
446
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
446
    }
702
703
446
    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
446
    _rows_input_counter =
708
446
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
446
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
446
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
446
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
446
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
446
    _memory_used_counter =
714
446
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
446
    _common_profile->add_info_string("IsColocate",
716
446
                                     std::to_string(_parent->is_colocated_operator()));
717
446
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
446
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
446
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
446
    return Status::OK();
721
446
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.60k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.60k
    _operator_profile =
664
2.60k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.60k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.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
2.60k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.60k
    _operator_profile->add_child(_common_profile, true);
673
2.60k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.60k
    _operator_profile->set_metadata(_parent->node_id());
676
2.60k
    _wait_for_finish_dependency_timer =
677
2.60k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.60k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.60k
    if constexpr (!is_fake_shared) {
680
2.60k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.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
2.60k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.60k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.60k
            _dependency = _shared_state->create_sink_dependency(
697
2.60k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.60k
        }
699
2.60k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.60k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.60k
    }
702
703
2.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
2.60k
    _rows_input_counter =
708
2.60k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.60k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.60k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.60k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.60k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.60k
    _memory_used_counter =
714
2.60k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.60k
    _common_profile->add_info_string("IsColocate",
716
2.60k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.60k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.60k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.60k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.60k
    return Status::OK();
721
2.60k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.4k
    _operator_profile =
664
12.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.4k
    _operator_profile->add_child(_common_profile, true);
673
12.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.4k
    _operator_profile->set_metadata(_parent->node_id());
676
12.4k
    _wait_for_finish_dependency_timer =
677
12.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.4k
    if constexpr (!is_fake_shared) {
680
12.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.4k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.4k
            _dependency = _shared_state->create_sink_dependency(
697
12.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.4k
        }
699
12.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.4k
    }
702
703
12.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.4k
    _rows_input_counter =
708
12.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.4k
    _memory_used_counter =
714
12.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.4k
    _common_profile->add_info_string("IsColocate",
716
12.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.4k
    return Status::OK();
721
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
235k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
235k
    _operator_profile =
664
235k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
235k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
235k
    _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
235k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
235k
    _operator_profile->add_child(_common_profile, true);
673
235k
    _operator_profile->add_child(_custom_profile, true);
674
675
235k
    _operator_profile->set_metadata(_parent->node_id());
676
235k
    _wait_for_finish_dependency_timer =
677
235k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
235k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
235k
    if constexpr (!is_fake_shared) {
680
235k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
235k
            info.shared_state_map.end()) {
682
235k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
235k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
235k
            }
685
235k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
235k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
235k
                                                  ? 0
688
235k
                                                  : info.task_idx]
689
235k
                                  .get();
690
235k
            _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
235k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
235k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
235k
    }
702
703
235k
    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
235k
    _rows_input_counter =
708
235k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
235k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
235k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
235k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
235k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
235k
    _memory_used_counter =
714
235k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
235k
    _common_profile->add_info_string("IsColocate",
716
235k
                                     std::to_string(_parent->is_colocated_operator()));
717
235k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
235k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
235k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
235k
    return Status::OK();
721
235k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
424k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
424k
    _operator_profile =
664
424k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
424k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
424k
    _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
424k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
424k
    _operator_profile->add_child(_common_profile, true);
673
424k
    _operator_profile->add_child(_custom_profile, true);
674
675
424k
    _operator_profile->set_metadata(_parent->node_id());
676
424k
    _wait_for_finish_dependency_timer =
677
424k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
424k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
424k
    if constexpr (!is_fake_shared) {
680
424k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
424k
            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
424k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
424k
            _shared_state = info.shared_state->template cast<SharedState>();
696
424k
            _dependency = _shared_state->create_sink_dependency(
697
424k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
424k
        }
699
424k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
424k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
424k
    }
702
703
424k
    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
424k
    _rows_input_counter =
708
424k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
424k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
424k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
424k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
424k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
424k
    _memory_used_counter =
714
424k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
424k
    _common_profile->add_info_string("IsColocate",
716
424k
                                     std::to_string(_parent->is_colocated_operator()));
717
424k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
424k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
424k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
424k
    return Status::OK();
721
424k
}
_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.69M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.69M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.69M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.19M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.19M
    }
731
1.69M
    _closed = true;
732
1.69M
    return Status::OK();
733
1.69M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
116k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
116k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
116k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
116k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
116k
    }
731
116k
    _closed = true;
732
116k
    return Status::OK();
733
116k
}
_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
209k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
209k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
209k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
209k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
209k
    }
731
209k
    _closed = true;
732
209k
    return Status::OK();
733
209k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
24
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
24
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
22
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
22
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
22
    }
731
22
    _closed = true;
732
22
    return Status::OK();
733
24
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.74k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.74k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.74k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.74k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.74k
    }
731
6.74k
    _closed = true;
732
6.74k
    return Status::OK();
733
6.74k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.11k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.11k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.11k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.11k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.11k
    }
731
7.11k
    _closed = true;
732
7.11k
    return Status::OK();
733
7.11k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
88.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
88.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
88.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
88.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
88.0k
    }
731
88.0k
    _closed = true;
732
88.0k
    return Status::OK();
733
88.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
76.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
76.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
76.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
76.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
76.6k
    }
731
76.6k
    _closed = true;
732
76.6k
    return Status::OK();
733
76.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
199
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
199
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
199
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
199
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
199
    }
731
199
    _closed = true;
732
199
    return Status::OK();
733
199
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
504k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
504k
    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
504k
    _closed = true;
732
504k
    return Status::OK();
733
504k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.88k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.88k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.88k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.88k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.88k
    }
731
7.88k
    _closed = true;
732
7.88k
    return Status::OK();
733
7.88k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
343
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
343
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
343
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
343
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
343
    }
731
343
    _closed = true;
732
343
    return Status::OK();
733
343
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.65k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.65k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.65k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.65k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.65k
    }
731
2.65k
    _closed = true;
732
2.65k
    return Status::OK();
733
2.65k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.4k
    }
731
12.4k
    _closed = true;
732
12.4k
    return Status::OK();
733
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
236k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
236k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
236k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
236k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
236k
    }
731
236k
    _closed = true;
732
236k
    return Status::OK();
733
236k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
428k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
428k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
428k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
428k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
428k
    }
731
428k
    _closed = true;
732
428k
    return Status::OK();
733
428k
}
_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
8.01k
                                                          bool* eos) {
738
8.01k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
8.01k
    return pull(state, block, eos);
740
8.01k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
37
                                                          bool* eos) {
738
37
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
37
    return pull(state, block, eos);
740
37
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
7.97k
                                                          bool* eos) {
738
7.97k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.97k
    return pull(state, block, eos);
740
7.97k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
567k
                                                         bool* eos) {
745
567k
    auto& local_state = get_local_state(state);
746
567k
    if (need_more_input_data(state)) {
747
537k
        local_state._child_block->clear_column_data(
748
537k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
537k
                        .num_materialized_slots());
750
537k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
537k
                state, local_state._child_block.get(), &local_state._child_eos));
752
537k
        *eos = local_state._child_eos;
753
537k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
82.8k
            return Status::OK();
755
82.8k
        }
756
454k
        {
757
454k
            SCOPED_TIMER(local_state.exec_time_counter());
758
454k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
454k
        }
760
454k
    }
761
762
484k
    if (!need_more_input_data(state)) {
763
456k
        SCOPED_TIMER(local_state.exec_time_counter());
764
456k
        bool new_eos = false;
765
456k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
456k
        if (new_eos) {
767
381k
            *eos = true;
768
381k
        } else if (!need_more_input_data(state)) {
769
23.5k
            *eos = false;
770
23.5k
        }
771
456k
    }
772
484k
    return Status::OK();
773
484k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
136k
                                                         bool* eos) {
745
136k
    auto& local_state = get_local_state(state);
746
136k
    if (need_more_input_data(state)) {
747
118k
        local_state._child_block->clear_column_data(
748
118k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
118k
                        .num_materialized_slots());
750
118k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
118k
                state, local_state._child_block.get(), &local_state._child_eos));
752
118k
        *eos = local_state._child_eos;
753
118k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
36.4k
            return Status::OK();
755
36.4k
        }
756
81.8k
        {
757
81.8k
            SCOPED_TIMER(local_state.exec_time_counter());
758
81.8k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
81.8k
        }
760
81.8k
    }
761
762
99.7k
    if (!need_more_input_data(state)) {
763
99.7k
        SCOPED_TIMER(local_state.exec_time_counter());
764
99.7k
        bool new_eos = false;
765
99.7k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
99.7k
        if (new_eos) {
767
44.1k
            *eos = true;
768
55.6k
        } else if (!need_more_input_data(state)) {
769
10.5k
            *eos = false;
770
10.5k
        }
771
99.7k
    }
772
99.7k
    return Status::OK();
773
99.7k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.35k
                                                         bool* eos) {
745
4.35k
    auto& local_state = get_local_state(state);
746
4.35k
    if (need_more_input_data(state)) {
747
2.43k
        local_state._child_block->clear_column_data(
748
2.43k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.43k
                        .num_materialized_slots());
750
2.43k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.43k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.43k
        *eos = local_state._child_eos;
753
2.43k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
513
            return Status::OK();
755
513
        }
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.85k
    if (!need_more_input_data(state)) {
763
3.85k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.85k
        bool new_eos = false;
765
3.85k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.85k
        if (new_eos) {
767
1.29k
            *eos = true;
768
2.56k
        } else if (!need_more_input_data(state)) {
769
1.93k
            *eos = false;
770
1.93k
        }
771
3.85k
    }
772
3.84k
    return Status::OK();
773
3.84k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.89k
                                                         bool* eos) {
745
1.89k
    auto& local_state = get_local_state(state);
746
1.89k
    if (need_more_input_data(state)) {
747
1.89k
        local_state._child_block->clear_column_data(
748
1.89k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.89k
                        .num_materialized_slots());
750
1.89k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.89k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.89k
        *eos = local_state._child_eos;
753
1.89k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
775
            return Status::OK();
755
775
        }
756
1.11k
        {
757
1.11k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.11k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.11k
        }
760
1.11k
    }
761
762
1.11k
    if (!need_more_input_data(state)) {
763
1.11k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.11k
        bool new_eos = false;
765
1.11k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.11k
        if (new_eos) {
767
784
            *eos = true;
768
784
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.11k
    }
772
1.11k
    return Status::OK();
773
1.11k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
14.7k
                                                         bool* eos) {
745
14.7k
    auto& local_state = get_local_state(state);
746
14.7k
    if (need_more_input_data(state)) {
747
14.7k
        local_state._child_block->clear_column_data(
748
14.7k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
14.7k
                        .num_materialized_slots());
750
14.7k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
14.7k
                state, local_state._child_block.get(), &local_state._child_eos));
752
14.7k
        *eos = local_state._child_eos;
753
14.7k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
3.52k
            return Status::OK();
755
3.52k
        }
756
11.1k
        {
757
11.1k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.1k
        }
760
11.1k
    }
761
762
11.1k
    if (!need_more_input_data(state)) {
763
6.29k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.29k
        bool new_eos = false;
765
6.29k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.29k
        if (new_eos) {
767
6.24k
            *eos = true;
768
6.24k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
6.29k
    }
772
11.1k
    return Status::OK();
773
11.1k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
379k
                                                         bool* eos) {
745
379k
    auto& local_state = get_local_state(state);
746
380k
    if (need_more_input_data(state)) {
747
380k
        local_state._child_block->clear_column_data(
748
380k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
380k
                        .num_materialized_slots());
750
380k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
380k
                state, local_state._child_block.get(), &local_state._child_eos));
752
380k
        *eos = local_state._child_eos;
753
380k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
39.7k
            return Status::OK();
755
39.7k
        }
756
340k
        {
757
340k
            SCOPED_TIMER(local_state.exec_time_counter());
758
340k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
340k
        }
760
340k
    }
761
762
339k
    if (!need_more_input_data(state)) {
763
317k
        SCOPED_TIMER(local_state.exec_time_counter());
764
317k
        bool new_eos = false;
765
317k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
317k
        if (new_eos) {
767
316k
            *eos = true;
768
316k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
317k
    }
772
339k
    return Status::OK();
773
339k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
21.8k
                                                         bool* eos) {
745
21.8k
    auto& local_state = get_local_state(state);
746
21.8k
    if (need_more_input_data(state)) {
747
11.1k
        local_state._child_block->clear_column_data(
748
11.1k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
11.1k
                        .num_materialized_slots());
750
11.1k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
11.1k
                state, local_state._child_block.get(), &local_state._child_eos));
752
11.1k
        *eos = local_state._child_eos;
753
11.1k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
804
            return Status::OK();
755
804
        }
756
10.3k
        {
757
10.3k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.3k
        }
760
10.3k
    }
761
762
21.0k
    if (!need_more_input_data(state)) {
763
20.5k
        SCOPED_TIMER(local_state.exec_time_counter());
764
20.5k
        bool new_eos = false;
765
20.5k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
20.5k
        if (new_eos) {
767
6.73k
            *eos = true;
768
13.7k
        } else if (!need_more_input_data(state)) {
769
10.6k
            *eos = false;
770
10.6k
        }
771
20.5k
    }
772
21.0k
    return Status::OK();
773
21.0k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
8.61k
                                                         bool* eos) {
745
8.61k
    auto& local_state = get_local_state(state);
746
8.61k
    if (need_more_input_data(state)) {
747
8.24k
        local_state._child_block->clear_column_data(
748
8.24k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
8.24k
                        .num_materialized_slots());
750
8.24k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
8.24k
                state, local_state._child_block.get(), &local_state._child_eos));
752
8.24k
        *eos = local_state._child_eos;
753
8.24k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
926
            return Status::OK();
755
926
        }
756
7.32k
        {
757
7.32k
            SCOPED_TIMER(local_state.exec_time_counter());
758
7.32k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
7.32k
        }
760
7.32k
    }
761
762
7.68k
    if (!need_more_input_data(state)) {
763
7.67k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.67k
        bool new_eos = false;
765
7.67k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.67k
        if (new_eos) {
767
5.64k
            *eos = true;
768
5.64k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
7.67k
    }
772
7.68k
    return Status::OK();
773
7.68k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
44.9k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
44.9k
    RETURN_IF_ERROR(Base::init(state, info));
779
44.9k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
44.9k
                                                         "AsyncWriterDependency", true);
781
44.9k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
44.9k
                             _finish_dependency));
783
784
44.9k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
44.9k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
44.9k
    return Status::OK();
787
44.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
356
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
356
    RETURN_IF_ERROR(Base::init(state, info));
779
356
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
356
                                                         "AsyncWriterDependency", true);
781
356
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
356
                             _finish_dependency));
783
784
356
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
356
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
356
    return Status::OK();
787
356
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
44.5k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
44.5k
    RETURN_IF_ERROR(Base::init(state, info));
779
44.5k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
44.5k
                                                         "AsyncWriterDependency", true);
781
44.5k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
44.5k
                             _finish_dependency));
783
784
44.5k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
44.5k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
44.5k
    return Status::OK();
787
44.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
60
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
60
    RETURN_IF_ERROR(Base::init(state, info));
779
60
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
60
                                                         "AsyncWriterDependency", true);
781
60
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
60
                             _finish_dependency));
783
784
60
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
60
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
60
    return Status::OK();
787
60
}
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
45.3k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
45.3k
    RETURN_IF_ERROR(Base::open(state));
793
45.3k
    _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.3k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
45.3k
    return Status::OK();
800
45.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
358
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
358
    RETURN_IF_ERROR(Base::open(state));
793
358
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.85k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.49k
        RETURN_IF_ERROR(
796
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.49k
    }
798
358
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
358
    return Status::OK();
800
358
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
44.9k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
44.9k
    RETURN_IF_ERROR(Base::open(state));
793
44.9k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
355k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
310k
        RETURN_IF_ERROR(
796
310k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
310k
    }
798
44.9k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
44.9k
    return Status::OK();
800
44.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
60
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
60
    RETURN_IF_ERROR(Base::open(state));
793
60
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.08k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.02k
        RETURN_IF_ERROR(
796
1.02k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.02k
    }
798
60
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
60
    return Status::OK();
800
60
}
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
59.7k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
59.7k
    return _writer->sink(block, eos);
806
59.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.10k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.10k
    return _writer->sink(block, eos);
806
1.10k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
58.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
58.5k
    return _writer->sink(block, eos);
806
58.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
60
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
60
    return _writer->sink(block, eos);
806
60
}
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
45.3k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
45.3k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
45.3k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
45.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
45.4k
    if (_writer) {
818
45.4k
        Status st = _writer->get_writer_status();
819
45.4k
        if (exec_status.ok()) {
820
45.3k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
45.3k
                                                       : Status::Cancelled("force close"));
822
45.3k
        } else {
823
84
            _writer->force_close(exec_status);
824
84
        }
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
45.4k
        RETURN_IF_ERROR(st);
829
45.4k
    }
830
45.3k
    return Base::close(state, exec_status);
831
45.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
347
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
347
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
347
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
347
    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
347
    if (_writer) {
818
347
        Status st = _writer->get_writer_status();
819
347
        if (exec_status.ok()) {
820
347
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
347
                                                       : Status::Cancelled("force close"));
822
347
        } 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
347
        RETURN_IF_ERROR(st);
829
347
    }
830
347
    return Base::close(state, exec_status);
831
347
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
44.9k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
44.9k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
44.9k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
44.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
45.0k
    if (_writer) {
818
45.0k
        Status st = _writer->get_writer_status();
819
45.0k
        if (exec_status.ok()) {
820
44.9k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
44.9k
                                                       : Status::Cancelled("force close"));
822
44.9k
        } else {
823
84
            _writer->force_close(exec_status);
824
84
        }
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
45.0k
        RETURN_IF_ERROR(st);
829
45.0k
    }
830
44.9k
    return Base::close(state, exec_status);
831
44.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
60
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
60
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
60
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
60
    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
60
    if (_writer) {
818
60
        Status st = _writer->get_writer_status();
819
60
        if (exec_status.ok()) {
820
60
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
60
                                                       : Status::Cancelled("force close"));
822
60
        } 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
60
        RETURN_IF_ERROR(st);
829
60
    }
830
60
    return Base::close(state, exec_status);
831
60
}
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