Coverage Report

Created: 2026-08-18 09:28

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.47M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.47M
    if (_parent->nereids_id() == -1) {
122
761k
        return fmt::format("(id={})", _parent->node_id());
123
761k
    } else {
124
718k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
718k
    }
126
1.47M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
63.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
63.6k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
63.6k
    } else {
124
63.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
63.6k
    }
126
63.6k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1
    if (_parent->nereids_id() == -1) {
122
1
        return fmt::format("(id={})", _parent->node_id());
123
1
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
174k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
174k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
174k
    } else {
124
174k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
174k
    }
126
174k
}
_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
5.38k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.38k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.38k
    } else {
124
5.38k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.38k
    }
126
5.38k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.68k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.68k
    if (_parent->nereids_id() == -1) {
122
11
        return fmt::format("(id={})", _parent->node_id());
123
8.67k
    } else {
124
8.67k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.67k
    }
126
8.68k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
83.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
83.6k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
83.6k
    } else {
124
83.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
83.6k
    }
126
83.6k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
60.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
60.4k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
60.4k
    } else {
124
60.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
60.4k
    }
126
60.4k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
170
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
170
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
170
    } else {
124
170
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
170
    }
126
170
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
501k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
501k
    if (_parent->nereids_id() == -1) {
122
235k
        return fmt::format("(id={})", _parent->node_id());
123
266k
    } else {
124
266k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
266k
    }
126
501k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
50.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
50.6k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
50.6k
    } else {
124
50.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
50.6k
    }
126
50.6k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.88k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.88k
    if (_parent->nereids_id() == -1) {
122
4.87k
        return fmt::format("(id={})", _parent->node_id());
123
4.87k
    } else {
124
4
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4
    }
126
4.88k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
473
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
473
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
371
    } else {
124
371
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
371
    }
126
473
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.85k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.85k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
4.84k
    } else {
124
4.84k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4.84k
    }
126
4.85k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
521k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
521k
    if (_parent->nereids_id() == -1) {
122
521k
        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
521k
}
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.03M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.03M
    if (_parent->nereids_id() == -1) {
131
582k
        return fmt::format("(id={})", _parent->node_id());
132
582k
    } else {
133
452k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
452k
    }
135
1.03M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
111k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
111k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
111k
    } else {
133
111k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
111k
    }
135
111k
}
_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
176k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
176k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
176k
    } else {
133
176k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
176k
    }
135
176k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
33
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
33
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
33
    } else {
133
33
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
33
    }
135
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.38k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.38k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.38k
    } else {
133
5.38k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.38k
    }
135
5.38k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.70k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.70k
    if (_parent->nereids_id() == -1) {
131
11
        return fmt::format("(id={})", _parent->node_id());
132
8.69k
    } else {
133
8.69k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.69k
    }
135
8.70k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
84.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
84.0k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
84.0k
    } else {
133
84.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
84.0k
    }
135
84.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
60.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
60.3k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
60.3k
    } else {
133
60.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
60.3k
    }
135
60.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
180
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
180
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
180
    } else {
133
180
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
180
    }
135
180
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
24
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
24
    if (_parent->nereids_id() == -1) {
131
24
        return fmt::format("(id={})", _parent->node_id());
132
24
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
24
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
4.82k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
4.82k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
4.82k
    } else {
133
4.82k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
4.82k
    }
135
4.82k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
473
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
473
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
371
    } else {
133
371
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
371
    }
135
473
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.4k
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.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
203k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
203k
    if (_parent->nereids_id() == -1) {
131
203k
        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
203k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
365k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
365k
    if (_parent->nereids_id() == -1) {
131
365k
        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
365k
}
_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
30.4k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
30.4k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
30.4k
    _terminated = true;
143
30.4k
    return Status::OK();
144
30.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.63k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.63k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.63k
    _terminated = true;
143
1.63k
    return Status::OK();
144
1.63k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1
    _terminated = true;
143
1
    return Status::OK();
144
1
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2.03k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.03k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.03k
    _terminated = true;
143
2.03k
    return Status::OK();
144
2.03k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.35k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.35k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.35k
    _terminated = true;
143
1.35k
    return Status::OK();
144
1.35k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
807
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
807
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
807
    _terminated = true;
143
807
    return Status::OK();
144
807
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
19
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
19
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
19
    _terminated = true;
143
19
    return Status::OK();
144
19
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
4
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
4
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
4
    _terminated = true;
143
4
    return Status::OK();
144
4
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
254
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
254
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
254
    _terminated = true;
143
254
    return Status::OK();
144
254
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
19
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
19
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
19
    _terminated = true;
143
19
    return Status::OK();
144
19
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
172
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
172
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
172
    _terminated = true;
143
172
    return Status::OK();
144
172
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1
    _terminated = true;
143
1
    return Status::OK();
144
1
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
133
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
133
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
133
    _terminated = true;
143
133
    return Status::OK();
144
133
}
145
146
270k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
270k
    return _child && _child->is_serial_operator() && !is_source()
148
270k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
270k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
270k
}
151
152
20.3k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
20.3k
    if (!_child) {
154
19.1k
        return false;
155
19.1k
    }
156
1.26k
    if (_child->is_serial_operator()) {
157
185
        return true;
158
185
    }
159
1.08k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.08k
    return child_distribution.need_local_exchange() &&
161
1.08k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.26k
}
163
164
81.7k
const RowDescriptor& OperatorBase::row_desc() const {
165
81.7k
    return _child->row_desc();
166
81.7k
}
167
168
template <typename SharedStateArg>
169
19.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
19.5k
    fmt::memory_buffer debug_string_buffer;
171
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
19.5k
    return fmt::to_string(debug_string_buffer);
173
19.5k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
3
    fmt::memory_buffer debug_string_buffer;
171
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
3
    return fmt::to_string(debug_string_buffer);
173
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
169
19.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
19.5k
    fmt::memory_buffer debug_string_buffer;
171
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
19.5k
    return fmt::to_string(debug_string_buffer);
173
19.5k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
1
    fmt::memory_buffer debug_string_buffer;
171
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
1
    return fmt::to_string(debug_string_buffer);
173
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
174
175
template <typename SharedStateArg>
176
19.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
19.5k
    fmt::memory_buffer debug_string_buffer;
178
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
19.5k
    return fmt::to_string(debug_string_buffer);
180
19.5k
}
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
176
19.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
19.5k
    fmt::memory_buffer debug_string_buffer;
178
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
19.5k
    return fmt::to_string(debug_string_buffer);
180
19.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
181
182
19.5k
std::string OperatorXBase::debug_string(int indentation_level) const {
183
19.5k
    fmt::memory_buffer debug_string_buffer;
184
19.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
185
19.5k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
186
19.5k
                   _is_serial_operator);
187
19.5k
    return fmt::to_string(debug_string_buffer);
188
19.5k
}
189
190
19.5k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
191
19.5k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
192
19.5k
}
193
194
579k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
195
579k
    std::string node_name = print_plan_node_type(tnode.node_type);
196
579k
    _nereids_id = tnode.nereids_id;
197
579k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
198
3.19k
        if (!tnode.__isset.output_tuple_id) {
199
0
            return Status::InternalError("no final output tuple id");
200
0
        }
201
3.19k
        if (tnode.intermediate_output_tuple_id_list.size() !=
202
3.19k
            tnode.intermediate_projections_list.size()) {
203
0
            return Status::InternalError(
204
0
                    "intermediate_output_tuple_id_list size:{} not match "
205
0
                    "intermediate_projections_list size:{}",
206
0
                    tnode.intermediate_output_tuple_id_list.size(),
207
0
                    tnode.intermediate_projections_list.size());
208
0
        }
209
3.19k
    }
210
579k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
211
579k
    _op_name = substr + "_OPERATOR";
212
213
579k
    if (tnode.__isset.vconjunct) {
214
0
        return Status::InternalError("vconjunct is not supported yet");
215
579k
    } else if (tnode.__isset.conjuncts) {
216
252k
        for (const auto& conjunct : tnode.conjuncts) {
217
252k
            VExprContextSPtr context;
218
252k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
219
252k
            _conjuncts.emplace_back(context);
220
252k
        }
221
85.9k
    }
222
223
    // create the projections expr
224
579k
    if (tnode.__isset.projections) {
225
234k
        DCHECK(tnode.__isset.output_tuple_id);
226
234k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
227
234k
    }
228
579k
    if (!tnode.intermediate_projections_list.empty()) {
229
3.19k
        DCHECK(tnode.__isset.projections) << "no final projections";
230
3.19k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
231
4.20k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
232
4.20k
            VExprContextSPtrs projections;
233
4.20k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
234
4.20k
            _intermediate_projections.push_back(projections);
235
4.20k
        }
236
3.19k
    }
237
579k
    return Status::OK();
238
579k
}
239
240
606k
Status OperatorXBase::prepare(RuntimeState* state) {
241
606k
    for (auto& conjunct : _conjuncts) {
242
251k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
243
251k
    }
244
606k
    if (state->enable_adjust_conjunct_order_by_cost()) {
245
555k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
246
325k
            return a->execute_cost() < b->execute_cost();
247
325k
        });
248
555k
    };
249
250
610k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
251
4.20k
        RETURN_IF_ERROR(
252
4.20k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
253
4.20k
    }
254
606k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
255
256
606k
    if (has_output_row_desc()) {
257
234k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
258
234k
    }
259
260
606k
    for (auto& conjunct : _conjuncts) {
261
252k
        RETURN_IF_ERROR(conjunct->open(state));
262
252k
    }
263
606k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
264
606k
    for (auto& projections : _intermediate_projections) {
265
4.20k
        RETURN_IF_ERROR(VExpr::open(projections, state));
266
4.20k
    }
267
606k
    if (_child && !is_source()) {
268
83.1k
        RETURN_IF_ERROR(_child->prepare(state));
269
83.1k
    }
270
271
606k
    if (VExpr::contains_blockable_function(_conjuncts) ||
272
606k
        VExpr::contains_blockable_function(_projections)) {
273
0
        _blockable = true;
274
0
    }
275
276
606k
    return Status::OK();
277
606k
}
278
279
7.20k
Status OperatorXBase::terminate(RuntimeState* state) {
280
7.20k
    if (_child && !is_source()) {
281
738
        RETURN_IF_ERROR(_child->terminate(state));
282
738
    }
283
7.20k
    auto result = state->get_local_state_result(operator_id());
284
7.20k
    if (!result) {
285
0
        return result.error();
286
0
    }
287
7.20k
    return result.value()->terminate(state);
288
7.20k
}
289
290
4.06M
Status OperatorXBase::close(RuntimeState* state) {
291
4.06M
    if (_child && !is_source()) {
292
662k
        RETURN_IF_ERROR(_child->close(state));
293
662k
    }
294
4.06M
    auto result = state->get_local_state_result(operator_id());
295
4.06M
    if (!result) {
296
0
        return result.error();
297
0
    }
298
4.06M
    return result.value()->close(state);
299
4.06M
}
300
301
264k
void PipelineXLocalStateBase::clear_origin_block() {
302
264k
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
303
264k
}
304
305
584k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
306
584k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
307
308
584k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
309
584k
    return Status::OK();
310
584k
}
311
312
0
bool PipelineXLocalStateBase::is_blockable() const {
313
0
    return std::any_of(_projections.begin(), _projections.end(),
314
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
315
0
}
316
317
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
318
264k
                                     Block* output_block) const {
319
264k
    auto* local_state = state->get_local_state(operator_id());
320
264k
    SCOPED_TIMER(local_state->exec_time_counter());
321
264k
    SCOPED_TIMER(local_state->_projection_timer);
322
264k
    const size_t rows = origin_block->rows();
323
264k
    if (rows == 0) {
324
136k
        return Status::OK();
325
136k
    }
326
128k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
327
328
128k
    {
329
128k
        Block input_block = *origin_block;
330
331
128k
        ColumnsWithTypeAndName new_columns;
332
128k
        for (const auto& projections : local_state->_intermediate_projections) {
333
1.21k
            if (projections.empty()) {
334
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
335
0
                                             node_id());
336
0
            }
337
1.21k
            new_columns.resize(projections.size());
338
7.64k
            for (int i = 0; i < projections.size(); i++) {
339
6.42k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
340
6.42k
                if (new_columns[i].column->size() != rows) {
341
0
                    return Status::InternalError(
342
0
                            "intermediate projection result column size {} not equal input rows "
343
0
                            "{}, expr: {}",
344
0
                            new_columns[i].column->size(), rows,
345
0
                            projections[i]->root()->debug_string());
346
0
                }
347
6.42k
            }
348
1.21k
            Block tmp_block {new_columns};
349
1.21k
            input_block.swap(tmp_block);
350
1.21k
        }
351
352
128k
        if (input_block.rows() != rows) {
353
0
            return Status::InternalError(
354
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
355
0
                    "input_block: {}",
356
0
                    input_block.rows(), rows, input_block.dump_structure());
357
0
        }
358
359
128k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
360
128k
                output_block, *_output_row_descriptor);
361
128k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
362
128k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
363
128k
        Columns shared_columns(mutable_columns.size());
364
365
695k
        for (int i = 0; i < mutable_columns.size(); ++i) {
366
566k
            ColumnPtr column_ptr;
367
566k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
368
566k
            if (column_ptr->size() != rows) {
369
0
                return Status::InternalError(
370
0
                        "projection result column size {} not equal input rows {}, expr: {}",
371
0
                        column_ptr->size(), rows,
372
0
                        local_state->_projections[i]->root()->debug_string());
373
0
            }
374
566k
            column_ptr = column_ptr->convert_to_full_column_if_const();
375
566k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
376
0
                column_ptr = make_nullable(column_ptr, false);
377
0
            }
378
566k
            if (column_ptr->is_exclusive()) {
379
202k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
380
364k
            } else {
381
364k
                shared_columns[i] = std::move(column_ptr);
382
364k
            }
383
566k
        }
384
385
128k
        scoped_mutable_block.restore();
386
695k
        for (int i = 0; i < shared_columns.size(); ++i) {
387
566k
            if (shared_columns[i]) {
388
364k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
389
364k
            }
390
566k
        }
391
128k
    }
392
393
0
    origin_block->clear_column_data(
394
128k
            local_state->_parent->intermediate_row_desc().num_materialized_slots());
395
128k
    DCHECK_EQ(output_block->rows(), rows);
396
397
128k
    return Status::OK();
398
128k
}
399
400
3.99M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
401
3.99M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
402
3.99M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
403
3.99M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
404
3.99M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
405
3.99M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
406
3.99M
            if (_debug_point_count++ % 2 == 0) {
407
3.99M
                return Status::OK();
408
3.99M
            }
409
3.99M
        }
410
3.99M
    });
411
412
3.99M
    Status status;
413
3.99M
    auto* local_state = state->get_local_state(operator_id());
414
3.99M
    Defer defer([&]() {
415
3.99M
        if (status.ok()) {
416
3.99M
            local_state->update_output_block_counters(*block);
417
3.99M
        }
418
3.99M
    });
419
3.99M
    if (_output_row_descriptor) {
420
264k
        local_state->clear_origin_block();
421
264k
        status = get_block(state, &local_state->_origin_block, eos);
422
264k
        if (UNLIKELY(!status.ok())) {
423
20
            return status;
424
20
        }
425
264k
        status = do_projections(state, &local_state->_origin_block, block);
426
264k
        return status;
427
264k
    }
428
3.72M
    status = get_block(state, block, eos);
429
3.72M
    RETURN_IF_ERROR(block->check_type_and_column());
430
3.72M
    return status;
431
3.72M
}
432
433
2.42M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
434
2.42M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
435
3.40k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
436
3.40k
        *eos = true;
437
3.40k
    }
438
439
2.42M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
440
2.42M
        auto op_name = to_lower(_parent->_op_name);
441
2.42M
        auto arg_op_name = dp->param<std::string>("op_name");
442
2.42M
        arg_op_name = to_lower(arg_op_name);
443
444
2.42M
        if (op_name == arg_op_name) {
445
2.42M
            *eos = true;
446
2.42M
        }
447
2.42M
    });
448
449
2.42M
    if (auto rows = block->rows()) {
450
711k
        _num_rows_returned += rows;
451
711k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
452
711k
    }
453
2.42M
}
454
455
30.4k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
456
30.4k
    auto result = state->get_sink_local_state_result();
457
30.4k
    if (!result) {
458
0
        return result.error();
459
0
    }
460
30.4k
    return result.value()->terminate(state);
461
30.4k
}
462
463
19.5k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
464
19.5k
    fmt::memory_buffer debug_string_buffer;
465
466
19.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
467
19.5k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
468
19.5k
    return fmt::to_string(debug_string_buffer);
469
19.5k
}
470
471
19.5k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
472
19.5k
    return state->get_sink_local_state()->debug_string(indentation_level);
473
19.5k
}
474
475
307k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
476
307k
    std::string op_name = "UNKNOWN_SINK";
477
307k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
478
479
307k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
480
307k
        op_name = it->second;
481
307k
    }
482
307k
    _name = op_name + "_OPERATOR";
483
307k
    return Status::OK();
484
307k
}
485
486
262k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
487
262k
    std::string op_name = print_plan_node_type(tnode.node_type);
488
262k
    _nereids_id = tnode.nereids_id;
489
262k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
490
262k
    _name = substr + "_SINK_OPERATOR";
491
262k
    return Status::OK();
492
262k
}
493
494
template <typename LocalStateType>
495
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
496
1.46M
                                                            LocalSinkStateInfo& info) {
497
1.46M
    auto local_state = LocalStateType::create_unique(this, state);
498
1.46M
    RETURN_IF_ERROR(local_state->init(state, info));
499
1.46M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
1.46M
    return Status::OK();
501
1.46M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
111k
                                                            LocalSinkStateInfo& info) {
497
111k
    auto local_state = LocalStateType::create_unique(this, state);
498
111k
    RETURN_IF_ERROR(local_state->init(state, info));
499
111k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
111k
    return Status::OK();
501
111k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
323k
                                                            LocalSinkStateInfo& info) {
497
323k
    auto local_state = LocalStateType::create_unique(this, state);
498
323k
    RETURN_IF_ERROR(local_state->init(state, info));
499
323k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
323k
    return Status::OK();
501
323k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
3
                                                            LocalSinkStateInfo& info) {
497
3
    auto local_state = LocalStateType::create_unique(this, state);
498
3
    RETURN_IF_ERROR(local_state->init(state, info));
499
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
3
    return Status::OK();
501
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
357
                                                            LocalSinkStateInfo& info) {
497
357
    auto local_state = LocalStateType::create_unique(this, state);
498
357
    RETURN_IF_ERROR(local_state->init(state, info));
499
357
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
357
    return Status::OK();
501
357
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
42.7k
                                                            LocalSinkStateInfo& info) {
497
42.7k
    auto local_state = LocalStateType::create_unique(this, state);
498
42.7k
    RETURN_IF_ERROR(local_state->init(state, info));
499
42.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
42.7k
    return Status::OK();
501
42.7k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
56
                                                            LocalSinkStateInfo& info) {
497
56
    auto local_state = LocalStateType::create_unique(this, state);
498
56
    RETURN_IF_ERROR(local_state->init(state, info));
499
56
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
56
    return Status::OK();
501
56
}
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
496
8.69k
                                                            LocalSinkStateInfo& info) {
497
8.69k
    auto local_state = LocalStateType::create_unique(this, state);
498
8.69k
    RETURN_IF_ERROR(local_state->init(state, info));
499
8.69k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
8.69k
    return Status::OK();
501
8.69k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
21
                                                            LocalSinkStateInfo& info) {
497
21
    auto local_state = LocalStateType::create_unique(this, state);
498
21
    RETURN_IF_ERROR(local_state->init(state, info));
499
21
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
21
    return Status::OK();
501
21
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
177k
                                                            LocalSinkStateInfo& info) {
497
177k
    auto local_state = LocalStateType::create_unique(this, state);
498
177k
    RETURN_IF_ERROR(local_state->init(state, info));
499
177k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
177k
    return Status::OK();
501
177k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
33
                                                            LocalSinkStateInfo& info) {
497
33
    auto local_state = LocalStateType::create_unique(this, state);
498
33
    RETURN_IF_ERROR(local_state->init(state, info));
499
33
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
33
    return Status::OK();
501
33
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
203k
                                                            LocalSinkStateInfo& info) {
497
203k
    auto local_state = LocalStateType::create_unique(this, state);
498
203k
    RETURN_IF_ERROR(local_state->init(state, info));
499
203k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
203k
    return Status::OK();
501
203k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
84.1k
                                                            LocalSinkStateInfo& info) {
497
84.1k
    auto local_state = LocalStateType::create_unique(this, state);
498
84.1k
    RETURN_IF_ERROR(local_state->init(state, info));
499
84.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
84.1k
    return Status::OK();
501
84.1k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
60.4k
                                                            LocalSinkStateInfo& info) {
497
60.4k
    auto local_state = LocalStateType::create_unique(this, state);
498
60.4k
    RETURN_IF_ERROR(local_state->init(state, info));
499
60.4k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
60.4k
    return Status::OK();
501
60.4k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
180
                                                            LocalSinkStateInfo& info) {
497
180
    auto local_state = LocalStateType::create_unique(this, state);
498
180
    RETURN_IF_ERROR(local_state->init(state, info));
499
180
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
180
    return Status::OK();
501
180
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
423k
                                                            LocalSinkStateInfo& info) {
497
423k
    auto local_state = LocalStateType::create_unique(this, state);
498
423k
    RETURN_IF_ERROR(local_state->init(state, info));
499
423k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
423k
    return Status::OK();
501
423k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
5.38k
                                                            LocalSinkStateInfo& info) {
497
5.38k
    auto local_state = LocalStateType::create_unique(this, state);
498
5.38k
    RETURN_IF_ERROR(local_state->init(state, info));
499
5.38k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
5.38k
    return Status::OK();
501
5.38k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
4.81k
                                                            LocalSinkStateInfo& info) {
497
4.81k
    auto local_state = LocalStateType::create_unique(this, state);
498
4.81k
    RETURN_IF_ERROR(local_state->init(state, info));
499
4.81k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
4.81k
    return Status::OK();
501
4.81k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.01k
                                                            LocalSinkStateInfo& info) {
497
2.01k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.01k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.01k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.01k
    return Status::OK();
501
2.01k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
371
                                                            LocalSinkStateInfo& info) {
497
371
    auto local_state = LocalStateType::create_unique(this, state);
498
371
    RETURN_IF_ERROR(local_state->init(state, info));
499
371
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
371
    return Status::OK();
501
371
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
4.77k
                                                            LocalSinkStateInfo& info) {
497
4.77k
    auto local_state = LocalStateType::create_unique(this, state);
498
4.77k
    RETURN_IF_ERROR(local_state->init(state, info));
499
4.77k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
4.77k
    return Status::OK();
501
4.77k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.54k
                                                            LocalSinkStateInfo& info) {
497
2.54k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.54k
    return Status::OK();
501
2.54k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.60k
                                                            LocalSinkStateInfo& info) {
497
2.60k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.60k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.60k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.60k
    return Status::OK();
501
2.60k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.47k
                                                            LocalSinkStateInfo& info) {
497
2.47k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.47k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.47k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.47k
    return Status::OK();
501
2.47k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
1
                                                            LocalSinkStateInfo& info) {
497
1
    auto local_state = LocalStateType::create_unique(this, state);
498
1
    RETURN_IF_ERROR(local_state->init(state, info));
499
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
1
    return Status::OK();
501
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
566
                                                            LocalSinkStateInfo& info) {
497
566
    auto local_state = LocalStateType::create_unique(this, state);
498
566
    RETURN_IF_ERROR(local_state->init(state, info));
499
566
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
566
    return Status::OK();
501
566
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
14
                                                            LocalSinkStateInfo& info) {
497
14
    auto local_state = LocalStateType::create_unique(this, state);
498
14
    RETURN_IF_ERROR(local_state->init(state, info));
499
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
14
    return Status::OK();
501
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
103
                                                            LocalSinkStateInfo& info) {
497
103
    auto local_state = LocalStateType::create_unique(this, state);
498
103
    RETURN_IF_ERROR(local_state->init(state, info));
499
103
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
103
    return Status::OK();
501
103
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
164
                                                            LocalSinkStateInfo& info) {
497
164
    auto local_state = LocalStateType::create_unique(this, state);
498
164
    RETURN_IF_ERROR(local_state->init(state, info));
499
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
164
    return Status::OK();
501
164
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
164
                                                            LocalSinkStateInfo& info) {
497
164
    auto local_state = LocalStateType::create_unique(this, state);
498
164
    RETURN_IF_ERROR(local_state->init(state, info));
499
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
164
    return Status::OK();
501
164
}
502
503
template <typename LocalStateType>
504
1.17M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
0
                                 LocalExchangeSharedState>) {
507
0
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
0
                                        MultiCastSharedState>) {
510
0
        throw Exception(Status::FatalError("should not reach here!"));
511
1.17M
    } else {
512
1.17M
        auto ss = LocalStateType::SharedStateType::create_shared();
513
1.17M
        ss->id = operator_id();
514
1.17M
        for (auto& dest : dests_id()) {
515
1.16M
            ss->related_op_ids.insert(dest);
516
1.16M
        }
517
1.17M
        return ss;
518
1.17M
    }
519
1.17M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
100k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
100k
    } else {
512
100k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
100k
        ss->id = operator_id();
514
100k
        for (auto& dest : dests_id()) {
515
100k
            ss->related_op_ids.insert(dest);
516
100k
        }
517
100k
        return ss;
518
100k
    }
519
100k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
323k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
323k
    } else {
512
323k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
323k
        ss->id = operator_id();
514
323k
        for (auto& dest : dests_id()) {
515
321k
            ss->related_op_ids.insert(dest);
516
321k
        }
517
323k
        return ss;
518
323k
    }
519
323k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
3
    } else {
512
3
        auto ss = LocalStateType::SharedStateType::create_shared();
513
3
        ss->id = operator_id();
514
3
        for (auto& dest : dests_id()) {
515
3
            ss->related_op_ids.insert(dest);
516
3
        }
517
3
        return ss;
518
3
    }
519
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
357
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
357
    } else {
512
357
        auto ss = LocalStateType::SharedStateType::create_shared();
513
357
        ss->id = operator_id();
514
357
        for (auto& dest : dests_id()) {
515
356
            ss->related_op_ids.insert(dest);
516
356
        }
517
357
        return ss;
518
357
    }
519
357
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
42.7k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
42.7k
    } else {
512
42.7k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
42.7k
        ss->id = operator_id();
514
42.7k
        for (auto& dest : dests_id()) {
515
42.5k
            ss->related_op_ids.insert(dest);
516
42.5k
        }
517
42.7k
        return ss;
518
42.7k
    }
519
42.7k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
504
56
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
56
    } else {
512
56
        auto ss = LocalStateType::SharedStateType::create_shared();
513
56
        ss->id = operator_id();
514
56
        for (auto& dest : dests_id()) {
515
56
            ss->related_op_ids.insert(dest);
516
56
        }
517
56
        return ss;
518
56
    }
519
56
}
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
504
8.71k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
8.71k
    } else {
512
8.71k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
8.71k
        ss->id = operator_id();
514
8.71k
        for (auto& dest : dests_id()) {
515
8.71k
            ss->related_op_ids.insert(dest);
516
8.71k
        }
517
8.71k
        return ss;
518
8.71k
    }
519
8.71k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
21
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
21
    } else {
512
21
        auto ss = LocalStateType::SharedStateType::create_shared();
513
21
        ss->id = operator_id();
514
21
        for (auto& dest : dests_id()) {
515
21
            ss->related_op_ids.insert(dest);
516
21
        }
517
21
        return ss;
518
21
    }
519
21
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
177k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
177k
    } else {
512
177k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
177k
        ss->id = operator_id();
514
177k
        for (auto& dest : dests_id()) {
515
177k
            ss->related_op_ids.insert(dest);
516
177k
        }
517
177k
        return ss;
518
177k
    }
519
177k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
35
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
35
    } else {
512
35
        auto ss = LocalStateType::SharedStateType::create_shared();
513
35
        ss->id = operator_id();
514
35
        for (auto& dest : dests_id()) {
515
35
            ss->related_op_ids.insert(dest);
516
35
        }
517
35
        return ss;
518
35
    }
519
35
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
84.3k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
84.3k
    } else {
512
84.3k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
84.3k
        ss->id = operator_id();
514
84.3k
        for (auto& dest : dests_id()) {
515
84.2k
            ss->related_op_ids.insert(dest);
516
84.2k
        }
517
84.3k
        return ss;
518
84.3k
    }
519
84.3k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
179
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
179
    } else {
512
179
        auto ss = LocalStateType::SharedStateType::create_shared();
513
179
        ss->id = operator_id();
514
179
        for (auto& dest : dests_id()) {
515
179
            ss->related_op_ids.insert(dest);
516
179
        }
517
179
        return ss;
518
179
    }
519
179
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
423k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
423k
    } else {
512
423k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
423k
        ss->id = operator_id();
514
423k
        for (auto& dest : dests_id()) {
515
418k
            ss->related_op_ids.insert(dest);
516
418k
        }
517
423k
        return ss;
518
423k
    }
519
423k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
5.39k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
5.39k
    } else {
512
5.39k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
5.39k
        ss->id = operator_id();
514
5.40k
        for (auto& dest : dests_id()) {
515
5.40k
            ss->related_op_ids.insert(dest);
516
5.40k
        }
517
5.39k
        return ss;
518
5.39k
    }
519
5.39k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
473
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
473
    } else {
512
473
        auto ss = LocalStateType::SharedStateType::create_shared();
513
473
        ss->id = operator_id();
514
473
        for (auto& dest : dests_id()) {
515
473
            ss->related_op_ids.insert(dest);
516
473
        }
517
473
        return ss;
518
473
    }
519
473
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
504
2.60k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
2.60k
    } else {
512
2.60k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
2.60k
        ss->id = operator_id();
514
2.61k
        for (auto& dest : dests_id()) {
515
2.61k
            ss->related_op_ids.insert(dest);
516
2.61k
        }
517
2.60k
        return ss;
518
2.60k
    }
519
2.60k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
504
2.50k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
2.50k
    } else {
512
2.50k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
2.50k
        ss->id = operator_id();
514
2.50k
        for (auto& dest : dests_id()) {
515
2.48k
            ss->related_op_ids.insert(dest);
516
2.48k
        }
517
2.50k
        return ss;
518
2.50k
    }
519
2.50k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
570
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
570
    } else {
512
570
        auto ss = LocalStateType::SharedStateType::create_shared();
513
570
        ss->id = operator_id();
514
570
        for (auto& dest : dests_id()) {
515
570
            ss->related_op_ids.insert(dest);
516
570
        }
517
570
        return ss;
518
570
    }
519
570
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
103
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
103
    } else {
512
103
        auto ss = LocalStateType::SharedStateType::create_shared();
513
103
        ss->id = operator_id();
514
103
        for (auto& dest : dests_id()) {
515
103
            ss->related_op_ids.insert(dest);
516
103
        }
517
103
        return ss;
518
103
    }
519
103
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
520
521
template <typename LocalStateType>
522
1.72M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.72M
    auto local_state = LocalStateType::create_unique(state, this);
524
1.72M
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.72M
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.72M
    return Status::OK();
527
1.72M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
63.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
63.8k
    auto local_state = LocalStateType::create_unique(state, this);
524
63.8k
    RETURN_IF_ERROR(local_state->init(state, info));
525
63.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
63.8k
    return Status::OK();
527
63.8k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
224k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
224k
    auto local_state = LocalStateType::create_unique(state, this);
524
224k
    RETURN_IF_ERROR(local_state->init(state, info));
525
224k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
224k
    return Status::OK();
527
224k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
142
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
142
    auto local_state = LocalStateType::create_unique(state, this);
524
142
    RETURN_IF_ERROR(local_state->init(state, info));
525
142
    state->emplace_local_state(operator_id(), std::move(local_state));
526
142
    return Status::OK();
527
142
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
3.07k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
3.07k
    auto local_state = LocalStateType::create_unique(state, this);
524
3.07k
    RETURN_IF_ERROR(local_state->init(state, info));
525
3.07k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
3.07k
    return Status::OK();
527
3.07k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
8.68k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
8.68k
    auto local_state = LocalStateType::create_unique(state, this);
524
8.68k
    RETURN_IF_ERROR(local_state->init(state, info));
525
8.68k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
8.68k
    return Status::OK();
527
8.68k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
8.59k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
8.59k
    auto local_state = LocalStateType::create_unique(state, this);
524
8.59k
    RETURN_IF_ERROR(local_state->init(state, info));
525
8.59k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
8.59k
    return Status::OK();
527
8.59k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
26
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
26
    auto local_state = LocalStateType::create_unique(state, this);
524
26
    RETURN_IF_ERROR(local_state->init(state, info));
525
26
    state->emplace_local_state(operator_id(), std::move(local_state));
526
26
    return Status::OK();
527
26
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
168k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
168k
    auto local_state = LocalStateType::create_unique(state, this);
524
168k
    RETURN_IF_ERROR(local_state->init(state, info));
525
168k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
168k
    return Status::OK();
527
168k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
84.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
84.0k
    auto local_state = LocalStateType::create_unique(state, this);
524
84.0k
    RETURN_IF_ERROR(local_state->init(state, info));
525
84.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
84.0k
    return Status::OK();
527
84.0k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
60.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
60.6k
    auto local_state = LocalStateType::create_unique(state, this);
524
60.6k
    RETURN_IF_ERROR(local_state->init(state, info));
525
60.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
60.6k
    return Status::OK();
527
60.6k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
170
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
170
    auto local_state = LocalStateType::create_unique(state, this);
524
170
    RETURN_IF_ERROR(local_state->init(state, info));
525
170
    state->emplace_local_state(operator_id(), std::move(local_state));
526
170
    return Status::OK();
527
170
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
3.59k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
3.59k
    auto local_state = LocalStateType::create_unique(state, this);
524
3.59k
    RETURN_IF_ERROR(local_state->init(state, info));
525
3.59k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
3.59k
    return Status::OK();
527
3.59k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
236k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
236k
    auto local_state = LocalStateType::create_unique(state, this);
524
236k
    RETURN_IF_ERROR(local_state->init(state, info));
525
236k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
236k
    return Status::OK();
527
236k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.47k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.47k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.47k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.47k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.47k
    return Status::OK();
527
1.47k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
5.37k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
5.37k
    auto local_state = LocalStateType::create_unique(state, this);
524
5.37k
    RETURN_IF_ERROR(local_state->init(state, info));
525
5.37k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
5.37k
    return Status::OK();
527
5.37k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
21
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
21
    auto local_state = LocalStateType::create_unique(state, this);
524
21
    RETURN_IF_ERROR(local_state->init(state, info));
525
21
    state->emplace_local_state(operator_id(), std::move(local_state));
526
21
    return Status::OK();
527
21
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.49k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.49k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.49k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.49k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.49k
    return Status::OK();
527
1.49k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
50.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
50.7k
    auto local_state = LocalStateType::create_unique(state, this);
524
50.7k
    RETURN_IF_ERROR(local_state->init(state, info));
525
50.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
50.7k
    return Status::OK();
527
50.7k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4.88k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4.88k
    auto local_state = LocalStateType::create_unique(state, this);
524
4.88k
    RETURN_IF_ERROR(local_state->init(state, info));
525
4.88k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4.88k
    return Status::OK();
527
4.88k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
370
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
370
    auto local_state = LocalStateType::create_unique(state, this);
524
370
    RETURN_IF_ERROR(local_state->init(state, info));
525
370
    state->emplace_local_state(operator_id(), std::move(local_state));
526
370
    return Status::OK();
527
370
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.56k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.56k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.56k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.56k
    return Status::OK();
527
2.56k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.44k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.44k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.44k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.44k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.44k
    return Status::OK();
527
2.44k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
308
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
308
    auto local_state = LocalStateType::create_unique(state, this);
524
308
    RETURN_IF_ERROR(local_state->init(state, info));
525
308
    state->emplace_local_state(operator_id(), std::move(local_state));
526
308
    return Status::OK();
527
308
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.56k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.56k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.56k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.56k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.56k
    return Status::OK();
527
1.56k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4.17k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4.17k
    auto local_state = LocalStateType::create_unique(state, this);
524
4.17k
    RETURN_IF_ERROR(local_state->init(state, info));
525
4.17k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4.17k
    return Status::OK();
527
4.17k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
526k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
526k
    auto local_state = LocalStateType::create_unique(state, this);
524
526k
    RETURN_IF_ERROR(local_state->init(state, info));
525
526k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
526k
    return Status::OK();
527
526k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
14
    auto local_state = LocalStateType::create_unique(state, this);
524
14
    RETURN_IF_ERROR(local_state->init(state, info));
525
14
    state->emplace_local_state(operator_id(), std::move(local_state));
526
14
    return Status::OK();
527
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
164
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
164
    auto local_state = LocalStateType::create_unique(state, this);
524
164
    RETURN_IF_ERROR(local_state->init(state, info));
525
164
    state->emplace_local_state(operator_id(), std::move(local_state));
526
164
    return Status::OK();
527
164
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.18k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.18k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.18k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.18k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.18k
    return Status::OK();
527
2.18k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
778
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
778
    auto local_state = LocalStateType::create_unique(state, this);
524
778
    RETURN_IF_ERROR(local_state->init(state, info));
525
778
    state->emplace_local_state(operator_id(), std::move(local_state));
526
778
    return Status::OK();
527
778
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
968
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
968
    auto local_state = LocalStateType::create_unique(state, this);
524
968
    RETURN_IF_ERROR(local_state->init(state, info));
525
968
    state->emplace_local_state(operator_id(), std::move(local_state));
526
968
    return Status::OK();
527
968
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
6.10k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
6.10k
    auto local_state = LocalStateType::create_unique(state, this);
524
6.10k
    RETURN_IF_ERROR(local_state->init(state, info));
525
6.10k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
6.10k
    return Status::OK();
527
6.10k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
246k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
246k
    auto local_state = LocalStateType::create_unique(state, this);
524
246k
    RETURN_IF_ERROR(local_state->init(state, info));
525
246k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
246k
    return Status::OK();
527
246k
}
528
529
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
530
                                                         RuntimeState* state)
531
1.45M
        : _parent(parent), _state(state) {}
532
533
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
534
1.71M
        : _num_rows_returned(0),
535
1.71M
          _rows_returned_counter(nullptr),
536
1.71M
          _parent(parent),
537
1.71M
          _state(state),
538
1.71M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
539
540
template <typename SharedStateArg>
541
1.72M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
1.72M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
1.72M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
1.72M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
1.72M
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
1.72M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
1.72M
    _operator_profile->add_child(_common_profile.get(), true);
550
1.72M
    _operator_profile->add_child(_custom_profile.get(), true);
551
1.72M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
1.72M
    if constexpr (!is_fake_shared) {
553
990k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
595k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
595k
                                    .first.get()
556
595k
                                    ->template cast<SharedStateArg>();
557
558
595k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
595k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
595k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
595k
        } else if (info.shared_state) {
562
335k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
0
                DCHECK(false);
564
0
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
335k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
335k
            _dependency = _shared_state->create_source_dependency(
569
335k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
335k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
335k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
335k
        } else {
573
59.4k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
4.53k
                DCHECK(false);
575
4.53k
            }
576
59.4k
        }
577
990k
    }
578
579
1.72M
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
1.72M
    _rows_returned_counter =
584
1.72M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
1.72M
    _blocks_returned_counter =
586
1.72M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
1.72M
    _output_block_bytes_counter =
588
1.72M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
1.72M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
1.72M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
1.72M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
1.72M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
1.72M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
1.72M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
1.72M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
1.72M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
1.72M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
1.72M
    _memory_used_counter =
599
1.72M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
1.72M
    _common_profile->add_info_string("IsColocate",
601
1.72M
                                     std::to_string(_parent->is_colocated_operator()));
602
1.72M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
1.72M
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
1.72M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
1.72M
    return Status::OK();
606
1.72M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
63.9k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
63.9k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
63.9k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
63.9k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
63.9k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
63.9k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
63.9k
    _operator_profile->add_child(_common_profile.get(), true);
550
63.9k
    _operator_profile->add_child(_custom_profile.get(), true);
551
63.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
63.9k
    if constexpr (!is_fake_shared) {
553
63.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
11.4k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
11.4k
                                    .first.get()
556
11.4k
                                    ->template cast<SharedStateArg>();
557
558
11.4k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
11.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
11.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
52.4k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
51.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
51.8k
            _dependency = _shared_state->create_source_dependency(
569
51.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
51.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
51.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
51.8k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
585
        }
577
63.9k
    }
578
579
63.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
63.9k
    _rows_returned_counter =
584
63.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
63.9k
    _blocks_returned_counter =
586
63.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
63.9k
    _output_block_bytes_counter =
588
63.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
63.9k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
63.9k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
63.9k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
63.9k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
63.9k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
63.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
63.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
63.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
63.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
63.9k
    _memory_used_counter =
599
63.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
63.9k
    _common_profile->add_info_string("IsColocate",
601
63.9k
                                     std::to_string(_parent->is_colocated_operator()));
602
63.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
63.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
63.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
63.9k
    return Status::OK();
606
63.9k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
1
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
1
    _operator_profile->add_child(_common_profile.get(), true);
550
1
    _operator_profile->add_child(_custom_profile.get(), true);
551
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
1
    if constexpr (!is_fake_shared) {
553
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
1
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
1
            _dependency = _shared_state->create_source_dependency(
569
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
1
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
1
    }
578
579
1
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
1
    _rows_returned_counter =
584
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
1
    _blocks_returned_counter =
586
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
1
    _output_block_bytes_counter =
588
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
1
    _memory_used_counter =
599
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
1
    _common_profile->add_info_string("IsColocate",
601
1
                                     std::to_string(_parent->is_colocated_operator()));
602
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
1
    return Status::OK();
606
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
177k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
177k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
177k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
177k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
177k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
177k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
177k
    _operator_profile->add_child(_common_profile.get(), true);
550
177k
    _operator_profile->add_child(_custom_profile.get(), true);
551
177k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
177k
    if constexpr (!is_fake_shared) {
553
177k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
177k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
173k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
173k
            _dependency = _shared_state->create_source_dependency(
569
173k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
173k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
173k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
173k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
4.61k
        }
577
177k
    }
578
579
177k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
177k
    _rows_returned_counter =
584
177k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
177k
    _blocks_returned_counter =
586
177k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
177k
    _output_block_bytes_counter =
588
177k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
177k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
177k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
177k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
177k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
177k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
177k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
177k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
177k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
177k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
177k
    _memory_used_counter =
599
177k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
177k
    _common_profile->add_info_string("IsColocate",
601
177k
                                     std::to_string(_parent->is_colocated_operator()));
602
177k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
177k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
177k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
177k
    return Status::OK();
606
177k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
26
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
26
    _operator_profile->add_child(_common_profile.get(), true);
550
26
    _operator_profile->add_child(_custom_profile.get(), true);
551
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
26
    if constexpr (!is_fake_shared) {
553
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
26
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
26
            _dependency = _shared_state->create_source_dependency(
569
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
26
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
26
    }
578
579
26
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
26
    _rows_returned_counter =
584
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
26
    _blocks_returned_counter =
586
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
26
    _output_block_bytes_counter =
588
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
26
    _memory_used_counter =
599
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
26
    _common_profile->add_info_string("IsColocate",
601
26
                                     std::to_string(_parent->is_colocated_operator()));
602
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
26
    return Status::OK();
606
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
5.39k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
5.39k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
5.39k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
5.39k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
5.39k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
5.39k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
5.39k
    _operator_profile->add_child(_common_profile.get(), true);
550
5.39k
    _operator_profile->add_child(_custom_profile.get(), true);
551
5.39k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
5.39k
    if constexpr (!is_fake_shared) {
553
5.39k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
5.39k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
5.37k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
5.37k
            _dependency = _shared_state->create_source_dependency(
569
5.37k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
5.37k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
5.37k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
5.37k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
23
        }
577
5.39k
    }
578
579
5.39k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
5.39k
    _rows_returned_counter =
584
5.39k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
5.39k
    _blocks_returned_counter =
586
5.39k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
5.39k
    _output_block_bytes_counter =
588
5.39k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
5.39k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
5.39k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
5.39k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
5.39k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
5.39k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
5.39k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
5.39k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
5.39k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
5.39k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
5.39k
    _memory_used_counter =
599
5.39k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
5.39k
    _common_profile->add_info_string("IsColocate",
601
5.39k
                                     std::to_string(_parent->is_colocated_operator()));
602
5.39k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
5.39k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
5.39k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
5.39k
    return Status::OK();
606
5.39k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
8.70k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
8.70k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
8.70k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
8.70k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
8.70k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
8.70k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
8.70k
    _operator_profile->add_child(_common_profile.get(), true);
550
8.70k
    _operator_profile->add_child(_custom_profile.get(), true);
551
8.70k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
8.70k
    if constexpr (!is_fake_shared) {
553
8.70k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
8.70k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
8.68k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
8.68k
            _dependency = _shared_state->create_source_dependency(
569
8.68k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
8.68k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
8.68k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
8.68k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
23
        }
577
8.70k
    }
578
579
8.70k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
8.70k
    _rows_returned_counter =
584
8.70k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
8.70k
    _blocks_returned_counter =
586
8.70k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
8.70k
    _output_block_bytes_counter =
588
8.70k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
8.70k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
8.70k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
8.70k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
8.70k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
8.70k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
8.70k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
8.70k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
8.70k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
8.70k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
8.70k
    _memory_used_counter =
599
8.70k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
8.70k
    _common_profile->add_info_string("IsColocate",
601
8.70k
                                     std::to_string(_parent->is_colocated_operator()));
602
8.70k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
8.70k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
8.70k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
8.70k
    return Status::OK();
606
8.70k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
84.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
84.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
84.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
84.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
84.2k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
84.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
84.2k
    _operator_profile->add_child(_common_profile.get(), true);
550
84.2k
    _operator_profile->add_child(_custom_profile.get(), true);
551
84.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
84.2k
    if constexpr (!is_fake_shared) {
553
84.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
84.2k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
83.4k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
83.4k
            _dependency = _shared_state->create_source_dependency(
569
83.4k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
83.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
83.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
83.4k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
826
        }
577
84.2k
    }
578
579
84.2k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
84.2k
    _rows_returned_counter =
584
84.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
84.2k
    _blocks_returned_counter =
586
84.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
84.2k
    _output_block_bytes_counter =
588
84.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
84.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
84.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
84.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
84.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
84.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
84.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
84.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
84.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
84.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
84.2k
    _memory_used_counter =
599
84.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
84.2k
    _common_profile->add_info_string("IsColocate",
601
84.2k
                                     std::to_string(_parent->is_colocated_operator()));
602
84.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
84.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
84.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
84.2k
    return Status::OK();
606
84.2k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
60.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
60.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
60.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
60.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
60.6k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
60.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
60.6k
    _operator_profile->add_child(_common_profile.get(), true);
550
60.6k
    _operator_profile->add_child(_custom_profile.get(), true);
551
60.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
60.6k
    if constexpr (!is_fake_shared) {
553
60.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
60.6k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
60.6k
                                    .first.get()
556
60.6k
                                    ->template cast<SharedStateArg>();
557
558
60.6k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
60.6k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
60.6k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
60.6k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
0
            _dependency = _shared_state->create_source_dependency(
569
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
29
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
29
        }
577
60.6k
    }
578
579
60.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
60.6k
    _rows_returned_counter =
584
60.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
60.6k
    _blocks_returned_counter =
586
60.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
60.6k
    _output_block_bytes_counter =
588
60.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
60.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
60.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
60.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
60.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
60.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
60.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
60.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
60.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
60.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
60.6k
    _memory_used_counter =
599
60.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
60.6k
    _common_profile->add_info_string("IsColocate",
601
60.6k
                                     std::to_string(_parent->is_colocated_operator()));
602
60.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
60.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
60.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
60.6k
    return Status::OK();
606
60.6k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
170
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
170
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
170
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
170
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
170
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
170
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
170
    _operator_profile->add_child(_common_profile.get(), true);
550
170
    _operator_profile->add_child(_custom_profile.get(), true);
551
170
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
170
    if constexpr (!is_fake_shared) {
553
170
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
170
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
170
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
170
            _dependency = _shared_state->create_source_dependency(
569
170
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
170
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
170
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
170
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
170
    }
578
579
170
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
170
    _rows_returned_counter =
584
170
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
170
    _blocks_returned_counter =
586
170
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
170
    _output_block_bytes_counter =
588
170
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
170
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
170
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
170
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
170
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
170
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
170
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
170
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
170
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
170
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
170
    _memory_used_counter =
599
170
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
170
    _common_profile->add_info_string("IsColocate",
601
170
                                     std::to_string(_parent->is_colocated_operator()));
602
170
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
170
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
170
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
170
    return Status::OK();
606
170
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
731k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
731k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
731k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
731k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
731k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
731k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
731k
    _operator_profile->add_child(_common_profile.get(), true);
550
731k
    _operator_profile->add_child(_custom_profile.get(), true);
551
731k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
    if constexpr (!is_fake_shared) {
553
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
                                    .first.get()
556
                                    ->template cast<SharedStateArg>();
557
558
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
            _dependency = _shared_state->create_source_dependency(
569
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
        }
577
    }
578
579
731k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
731k
    _rows_returned_counter =
584
731k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
731k
    _blocks_returned_counter =
586
731k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
731k
    _output_block_bytes_counter =
588
731k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
731k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
731k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
731k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
731k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
731k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
731k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
731k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
731k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
731k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
731k
    _memory_used_counter =
599
731k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
731k
    _common_profile->add_info_string("IsColocate",
601
731k
                                     std::to_string(_parent->is_colocated_operator()));
602
731k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
731k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
731k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
731k
    return Status::OK();
606
731k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
50.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
50.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
50.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
50.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
50.7k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
50.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
50.7k
    _operator_profile->add_child(_common_profile.get(), true);
550
50.7k
    _operator_profile->add_child(_custom_profile.get(), true);
551
50.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
50.7k
    if constexpr (!is_fake_shared) {
553
50.7k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
50.7k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
2.34k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
2.34k
            _dependency = _shared_state->create_source_dependency(
569
2.34k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
2.34k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
2.34k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
48.3k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
48.3k
        }
577
50.7k
    }
578
579
50.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
50.7k
    _rows_returned_counter =
584
50.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
50.7k
    _blocks_returned_counter =
586
50.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
50.7k
    _output_block_bytes_counter =
588
50.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
50.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
50.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
50.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
50.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
50.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
50.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
50.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
50.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
50.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
50.7k
    _memory_used_counter =
599
50.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
50.7k
    _common_profile->add_info_string("IsColocate",
601
50.7k
                                     std::to_string(_parent->is_colocated_operator()));
602
50.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
50.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
50.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
50.7k
    return Status::OK();
606
50.7k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
26
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
26
    _operator_profile->add_child(_common_profile.get(), true);
550
26
    _operator_profile->add_child(_custom_profile.get(), true);
551
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
26
    if constexpr (!is_fake_shared) {
553
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
26
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
26
            _dependency = _shared_state->create_source_dependency(
569
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
26
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
26
    }
578
579
26
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
26
    _rows_returned_counter =
584
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
26
    _blocks_returned_counter =
586
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
26
    _output_block_bytes_counter =
588
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
26
    _memory_used_counter =
599
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
26
    _common_profile->add_info_string("IsColocate",
601
26
                                     std::to_string(_parent->is_colocated_operator()));
602
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
26
    return Status::OK();
606
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
4.88k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
4.88k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
4.88k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
4.88k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
4.88k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
4.88k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
4.88k
    _operator_profile->add_child(_common_profile.get(), true);
550
4.88k
    _operator_profile->add_child(_custom_profile.get(), true);
551
4.88k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
4.88k
    if constexpr (!is_fake_shared) {
553
4.88k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
4.88k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
4.86k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
4.86k
            _dependency = _shared_state->create_source_dependency(
569
4.86k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
4.86k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
4.86k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
4.86k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
26
        }
577
4.88k
    }
578
579
4.88k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
4.88k
    _rows_returned_counter =
584
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
4.88k
    _blocks_returned_counter =
586
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
4.88k
    _output_block_bytes_counter =
588
4.88k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
4.88k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
4.88k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
4.88k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
4.88k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
4.88k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
4.88k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
4.88k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
4.88k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
4.88k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
4.88k
    _memory_used_counter =
599
4.88k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
4.88k
    _common_profile->add_info_string("IsColocate",
601
4.88k
                                     std::to_string(_parent->is_colocated_operator()));
602
4.88k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
4.88k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
4.88k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
4.88k
    return Status::OK();
606
4.88k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
473
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
473
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
473
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
473
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
473
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
473
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
473
    _operator_profile->add_child(_common_profile.get(), true);
550
473
    _operator_profile->add_child(_custom_profile.get(), true);
551
473
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
473
    if constexpr (!is_fake_shared) {
553
473
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
473
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
472
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
472
            _dependency = _shared_state->create_source_dependency(
569
472
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
472
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
472
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
472
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
1
        }
577
473
    }
578
579
473
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
473
    _rows_returned_counter =
584
473
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
473
    _blocks_returned_counter =
586
473
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
473
    _output_block_bytes_counter =
588
473
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
473
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
473
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
473
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
473
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
473
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
473
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
473
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
473
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
473
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
473
    _memory_used_counter =
599
473
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
473
    _common_profile->add_info_string("IsColocate",
601
473
                                     std::to_string(_parent->is_colocated_operator()));
602
473
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
473
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
473
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
473
    return Status::OK();
606
473
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
5.11k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
5.11k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
5.11k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
5.11k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
5.11k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
5.11k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
5.11k
    _operator_profile->add_child(_common_profile.get(), true);
550
5.11k
    _operator_profile->add_child(_custom_profile.get(), true);
551
5.11k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
5.11k
    if constexpr (!is_fake_shared) {
553
5.11k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
5.11k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
4.71k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
4.71k
            _dependency = _shared_state->create_source_dependency(
569
4.71k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
4.71k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
4.71k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
4.71k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
398
        }
577
5.11k
    }
578
579
5.11k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
5.11k
    _rows_returned_counter =
584
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
5.11k
    _blocks_returned_counter =
586
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
5.11k
    _output_block_bytes_counter =
588
5.11k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
5.11k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
5.11k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
5.11k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
5.11k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
5.11k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
5.11k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
5.11k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
5.11k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
5.11k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
5.11k
    _memory_used_counter =
599
5.11k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
5.11k
    _common_profile->add_info_string("IsColocate",
601
5.11k
                                     std::to_string(_parent->is_colocated_operator()));
602
5.11k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
5.11k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
5.11k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
5.11k
    return Status::OK();
606
5.11k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
528k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
528k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
528k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
528k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
528k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
528k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
528k
    _operator_profile->add_child(_common_profile.get(), true);
550
528k
    _operator_profile->add_child(_custom_profile.get(), true);
551
528k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
528k
    if constexpr (!is_fake_shared) {
553
528k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
523k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
523k
                                    .first.get()
556
523k
                                    ->template cast<SharedStateArg>();
557
558
523k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
523k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
523k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
523k
        } else if (info.shared_state) {
562
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
0
                DCHECK(false);
564
0
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
0
            _dependency = _shared_state->create_source_dependency(
569
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
4.53k
        } else {
573
4.53k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
4.53k
                DCHECK(false);
575
4.53k
            }
576
4.53k
        }
577
528k
    }
578
579
528k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
528k
    _rows_returned_counter =
584
528k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
528k
    _blocks_returned_counter =
586
528k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
528k
    _output_block_bytes_counter =
588
528k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
528k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
528k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
528k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
528k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
528k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
528k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
528k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
528k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
528k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
528k
    _memory_used_counter =
599
528k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
528k
    _common_profile->add_info_string("IsColocate",
601
528k
                                     std::to_string(_parent->is_colocated_operator()));
602
528k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
528k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
528k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
528k
    return Status::OK();
606
528k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
164
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
164
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
164
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
164
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
164
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
164
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
164
    _operator_profile->add_child(_common_profile.get(), true);
550
164
    _operator_profile->add_child(_custom_profile.get(), true);
551
164
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
164
    if constexpr (!is_fake_shared) {
553
164
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
164
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
164
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
164
            _dependency = _shared_state->create_source_dependency(
569
164
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
164
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
164
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
164
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
164
    }
578
579
164
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
164
    _rows_returned_counter =
584
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
164
    _blocks_returned_counter =
586
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
164
    _output_block_bytes_counter =
588
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
164
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
164
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
164
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
164
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
164
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
164
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
164
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
164
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
164
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
164
    _memory_used_counter =
599
164
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
164
    _common_profile->add_info_string("IsColocate",
601
164
                                     std::to_string(_parent->is_colocated_operator()));
602
164
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
164
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
164
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
164
    return Status::OK();
606
164
}
607
608
template <typename SharedStateArg>
609
1.73M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
1.73M
    _conjuncts.resize(_parent->_conjuncts.size());
611
1.73M
    _projections.resize(_parent->_projections.size());
612
2.01M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
279k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
279k
    }
615
3.49M
    for (size_t i = 0; i < _projections.size(); i++) {
616
1.76M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
1.76M
    }
618
1.73M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
1.73M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
6.49k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
39.6k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
33.1k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
33.1k
                    state, _intermediate_projections[i][j]));
624
33.1k
        }
625
6.49k
    }
626
1.73M
    return Status::OK();
627
1.73M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
64.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
64.0k
    _conjuncts.resize(_parent->_conjuncts.size());
611
64.0k
    _projections.resize(_parent->_projections.size());
612
64.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
741
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
741
    }
615
325k
    for (size_t i = 0; i < _projections.size(); i++) {
616
261k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
261k
    }
618
64.0k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
64.9k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
825
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
6.56k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
5.73k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
5.73k
                    state, _intermediate_projections[i][j]));
624
5.73k
        }
625
825
    }
626
64.0k
    return Status::OK();
627
64.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
3
    _conjuncts.resize(_parent->_conjuncts.size());
611
3
    _projections.resize(_parent->_projections.size());
612
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
3
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
3
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
3
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
3
    return Status::OK();
627
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
178k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
178k
    _conjuncts.resize(_parent->_conjuncts.size());
611
178k
    _projections.resize(_parent->_projections.size());
612
178k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
178k
    for (size_t i = 0; i < _projections.size(); i++) {
616
289
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
289
    }
618
178k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
178k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
178k
    return Status::OK();
627
178k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
26
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
26
    _conjuncts.resize(_parent->_conjuncts.size());
611
26
    _projections.resize(_parent->_projections.size());
612
26
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
26
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
26
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
26
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
26
    return Status::OK();
627
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
5.40k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
5.40k
    _conjuncts.resize(_parent->_conjuncts.size());
611
5.40k
    _projections.resize(_parent->_projections.size());
612
5.49k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
89
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
89
    }
615
25.7k
    for (size_t i = 0; i < _projections.size(); i++) {
616
20.3k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
20.3k
    }
618
5.40k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
5.42k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
17
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
156
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
139
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
139
                    state, _intermediate_projections[i][j]));
624
139
        }
625
17
    }
626
5.40k
    return Status::OK();
627
5.40k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
8.72k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
8.72k
    _conjuncts.resize(_parent->_conjuncts.size());
611
8.72k
    _projections.resize(_parent->_projections.size());
612
9.46k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
748
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
748
    }
615
23.4k
    for (size_t i = 0; i < _projections.size(); i++) {
616
14.7k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
14.7k
    }
618
8.72k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
8.81k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
91
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
690
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
599
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
599
                    state, _intermediate_projections[i][j]));
624
599
        }
625
91
    }
626
8.72k
    return Status::OK();
627
8.72k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
84.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
84.4k
    _conjuncts.resize(_parent->_conjuncts.size());
611
84.4k
    _projections.resize(_parent->_projections.size());
612
85.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
1.46k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
1.46k
    }
615
301k
    for (size_t i = 0; i < _projections.size(); i++) {
616
217k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
217k
    }
618
84.4k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
84.5k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
167
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
1.20k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
1.03k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
1.03k
                    state, _intermediate_projections[i][j]));
624
1.03k
        }
625
167
    }
626
84.4k
    return Status::OK();
627
84.4k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
60.7k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
60.7k
    _conjuncts.resize(_parent->_conjuncts.size());
611
60.7k
    _projections.resize(_parent->_projections.size());
612
60.7k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
24
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
24
    }
615
61.2k
    for (size_t i = 0; i < _projections.size(); i++) {
616
437
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
437
    }
618
60.7k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
60.7k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
1
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
3
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
2
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
2
                    state, _intermediate_projections[i][j]));
624
2
        }
625
1
    }
626
60.7k
    return Status::OK();
627
60.7k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
174
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
174
    _conjuncts.resize(_parent->_conjuncts.size());
611
174
    _projections.resize(_parent->_projections.size());
612
174
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
474
    for (size_t i = 0; i < _projections.size(); i++) {
616
300
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
300
    }
618
174
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
174
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
174
    return Status::OK();
627
174
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
736k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
736k
    _conjuncts.resize(_parent->_conjuncts.size());
611
736k
    _projections.resize(_parent->_projections.size());
612
1.01M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
276k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
276k
    }
615
1.89M
    for (size_t i = 0; i < _projections.size(); i++) {
616
1.16M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
1.16M
    }
618
736k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
741k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
5.38k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
31.0k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
25.6k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
25.6k
                    state, _intermediate_projections[i][j]));
624
25.6k
        }
625
5.38k
    }
626
736k
    return Status::OK();
627
736k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
50.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
50.9k
    _conjuncts.resize(_parent->_conjuncts.size());
611
50.9k
    _projections.resize(_parent->_projections.size());
612
50.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
136k
    for (size_t i = 0; i < _projections.size(); i++) {
616
85.0k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
85.0k
    }
618
50.9k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
50.9k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
50.9k
    return Status::OK();
627
50.9k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
25
    _conjuncts.resize(_parent->_conjuncts.size());
611
25
    _projections.resize(_parent->_projections.size());
612
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
25
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
25
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
25
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
25
    return Status::OK();
627
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
4.88k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
4.88k
    _conjuncts.resize(_parent->_conjuncts.size());
611
4.88k
    _projections.resize(_parent->_projections.size());
612
5.74k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
864
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
864
    }
615
4.88k
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
4.88k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
4.88k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
4.88k
    return Status::OK();
627
4.88k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
473
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
473
    _conjuncts.resize(_parent->_conjuncts.size());
611
473
    _projections.resize(_parent->_projections.size());
612
473
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
473
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
473
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
473
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
473
    return Status::OK();
627
473
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
5.18k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
5.18k
    _conjuncts.resize(_parent->_conjuncts.size());
611
5.18k
    _projections.resize(_parent->_projections.size());
612
5.18k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
5.35k
    for (size_t i = 0; i < _projections.size(); i++) {
616
168
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
168
    }
618
5.18k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
5.18k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
5.18k
    return Status::OK();
627
5.18k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
531k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
531k
    _conjuncts.resize(_parent->_conjuncts.size());
611
531k
    _projections.resize(_parent->_projections.size());
612
531k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
531k
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
531k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
531k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
531k
    return Status::OK();
627
531k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
164
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
164
    _conjuncts.resize(_parent->_conjuncts.size());
611
164
    _projections.resize(_parent->_projections.size());
612
171
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
7
    }
615
483
    for (size_t i = 0; i < _projections.size(); i++) {
616
319
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
319
    }
618
164
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
167
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
3
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
11
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
8
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
8
                    state, _intermediate_projections[i][j]));
624
8
        }
625
3
    }
626
164
    return Status::OK();
627
164
}
628
629
template <typename SharedStateArg>
630
7.20k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
7.20k
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
7.20k
    _terminated = true;
635
7.20k
    return Status::OK();
636
7.20k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
412
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
412
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
412
    _terminated = true;
635
412
    return Status::OK();
636
412
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
26
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
26
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
26
    _terminated = true;
635
26
    return Status::OK();
636
26
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
29
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
29
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
29
    _terminated = true;
635
29
    return Status::OK();
636
29
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
98
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
98
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
98
    _terminated = true;
635
98
    return Status::OK();
636
98
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
5.36k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
5.36k
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
5.36k
    _terminated = true;
635
5.36k
    return Status::OK();
636
5.36k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
14
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
14
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
14
    _terminated = true;
635
14
    return Status::OK();
636
14
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
387
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
387
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
387
    _terminated = true;
635
387
    return Status::OK();
636
387
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
844
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
844
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
844
    _terminated = true;
635
844
    return Status::OK();
636
844
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
33
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
33
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
33
    _terminated = true;
635
33
    return Status::OK();
636
33
}
637
638
template <typename SharedStateArg>
639
1.93M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
1.93M
    if (_closed) {
641
207k
        return Status::OK();
642
207k
    }
643
1.73M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
993k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
993k
    }
646
1.73M
    _closed = true;
647
1.73M
    return Status::OK();
648
1.93M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
64.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
64.0k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
64.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
64.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
64.0k
    }
646
64.0k
    _closed = true;
647
64.0k
    return Status::OK();
648
64.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
4
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
4
    }
646
4
    _closed = true;
647
4
    return Status::OK();
648
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
354k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
354k
    if (_closed) {
641
177k
        return Status::OK();
642
177k
    }
643
177k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
177k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
177k
    }
646
177k
    _closed = true;
647
177k
    return Status::OK();
648
354k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
26
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
26
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
26
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
26
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
26
    }
646
26
    _closed = true;
647
26
    return Status::OK();
648
26
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
5.40k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
5.40k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
5.40k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
5.40k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
5.40k
    }
646
5.40k
    _closed = true;
647
5.40k
    return Status::OK();
648
5.40k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
17.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
17.6k
    if (_closed) {
641
8.98k
        return Status::OK();
642
8.98k
    }
643
8.68k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
8.68k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
8.68k
    }
646
8.68k
    _closed = true;
647
8.68k
    return Status::OK();
648
17.6k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
84.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
84.1k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
84.1k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
84.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
84.1k
    }
646
84.1k
    _closed = true;
647
84.1k
    return Status::OK();
648
84.1k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
60.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
60.3k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
60.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
60.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
60.3k
    }
646
60.3k
    _closed = true;
647
60.3k
    return Status::OK();
648
60.3k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
169
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
169
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
169
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
169
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
169
    }
646
169
    _closed = true;
647
169
    return Status::OK();
648
169
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
751k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
751k
    if (_closed) {
641
14.3k
        return Status::OK();
642
14.3k
    }
643
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
    }
646
736k
    _closed = true;
647
736k
    return Status::OK();
648
751k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
50.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
50.9k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
50.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
50.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
50.9k
    }
646
50.9k
    _closed = true;
647
50.9k
    return Status::OK();
648
50.9k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
28
    if (_closed) {
641
14
        return Status::OK();
642
14
    }
643
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
14
    }
646
14
    _closed = true;
647
14
    return Status::OK();
648
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
4.85k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
4.85k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
4.85k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
4.85k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
4.85k
    }
646
4.85k
    _closed = true;
647
4.85k
    return Status::OK();
648
4.85k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
738
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
738
    if (_closed) {
641
368
        return Status::OK();
642
368
    }
643
370
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
370
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
370
    }
646
370
    _closed = true;
647
370
    return Status::OK();
648
738
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
10.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
10.7k
    if (_closed) {
641
5.56k
        return Status::OK();
642
5.56k
    }
643
5.17k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
5.17k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
5.17k
    }
646
5.17k
    _closed = true;
647
5.17k
    return Status::OK();
648
10.7k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
532k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
532k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
532k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
532k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
532k
    }
646
532k
    _closed = true;
647
532k
    return Status::OK();
648
532k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
323
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
323
    if (_closed) {
641
168
        return Status::OK();
642
168
    }
643
155
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
155
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
155
    }
646
155
    _closed = true;
647
155
    return Status::OK();
648
323
}
649
650
template <typename SharedState>
651
1.46M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
1.46M
    _operator_profile =
654
1.46M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
1.46M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
1.46M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
1.46M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
1.46M
    _operator_profile->add_child(_common_profile, true);
663
1.46M
    _operator_profile->add_child(_custom_profile, true);
664
665
1.46M
    _operator_profile->set_metadata(_parent->node_id());
666
1.46M
    _wait_for_finish_dependency_timer =
667
1.46M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
1.46M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
1.46M
    if constexpr (!is_fake_shared) {
670
1.04M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
1.04M
            info.shared_state_map.end()) {
672
276k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
204k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
204k
            }
675
276k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
276k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
276k
                                                  ? 0
678
276k
                                                  : info.task_idx]
679
276k
                                  .get();
680
276k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
764k
        } else {
682
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
18.4E
                DCHECK(false);
684
18.4E
            }
685
764k
            _shared_state = info.shared_state->template cast<SharedState>();
686
764k
            _dependency = _shared_state->create_sink_dependency(
687
764k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
764k
        }
689
1.04M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
1.04M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
1.04M
    }
692
693
1.46M
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
1.46M
    _rows_input_counter =
698
1.46M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
1.46M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
1.46M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
1.46M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
1.46M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
1.46M
    _memory_used_counter =
704
1.46M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
1.46M
    _common_profile->add_info_string("IsColocate",
706
1.46M
                                     std::to_string(_parent->is_colocated_operator()));
707
1.46M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
1.46M
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
1.46M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
1.46M
    return Status::OK();
711
1.46M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
111k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
111k
    _operator_profile =
654
111k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
111k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
111k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
111k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
111k
    _operator_profile->add_child(_common_profile, true);
663
111k
    _operator_profile->add_child(_custom_profile, true);
664
665
111k
    _operator_profile->set_metadata(_parent->node_id());
666
111k
    _wait_for_finish_dependency_timer =
667
111k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
111k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
111k
    if constexpr (!is_fake_shared) {
670
111k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
111k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
11.7k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
11.7k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
11.7k
                                                  ? 0
678
11.7k
                                                  : info.task_idx]
679
11.7k
                                  .get();
680
11.7k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
100k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
100k
            _shared_state = info.shared_state->template cast<SharedState>();
686
100k
            _dependency = _shared_state->create_sink_dependency(
687
100k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
100k
        }
689
111k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
111k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
111k
    }
692
693
111k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
111k
    _rows_input_counter =
698
111k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
111k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
111k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
111k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
111k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
111k
    _memory_used_counter =
704
111k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
111k
    _common_profile->add_info_string("IsColocate",
706
111k
                                     std::to_string(_parent->is_colocated_operator()));
707
111k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
111k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
111k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
111k
    return Status::OK();
711
111k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
2
    _operator_profile =
654
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
2
    _operator_profile->add_child(_common_profile, true);
663
2
    _operator_profile->add_child(_custom_profile, true);
664
665
2
    _operator_profile->set_metadata(_parent->node_id());
666
2
    _wait_for_finish_dependency_timer =
667
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
2
    if constexpr (!is_fake_shared) {
670
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
2
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
2
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
2
            _shared_state = info.shared_state->template cast<SharedState>();
686
2
            _dependency = _shared_state->create_sink_dependency(
687
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
2
        }
689
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
2
    }
692
693
2
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
2
    _rows_input_counter =
698
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
2
    _memory_used_counter =
704
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
2
    _common_profile->add_info_string("IsColocate",
706
2
                                     std::to_string(_parent->is_colocated_operator()));
707
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
2
    return Status::OK();
711
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
177k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
177k
    _operator_profile =
654
177k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
177k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
177k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
177k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
177k
    _operator_profile->add_child(_common_profile, true);
663
177k
    _operator_profile->add_child(_custom_profile, true);
664
665
177k
    _operator_profile->set_metadata(_parent->node_id());
666
177k
    _wait_for_finish_dependency_timer =
667
177k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
177k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
177k
    if constexpr (!is_fake_shared) {
670
177k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
177k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
177k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
177k
            _shared_state = info.shared_state->template cast<SharedState>();
686
177k
            _dependency = _shared_state->create_sink_dependency(
687
177k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
177k
        }
689
177k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
177k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
177k
    }
692
693
177k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
177k
    _rows_input_counter =
698
177k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
177k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
177k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
177k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
177k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
177k
    _memory_used_counter =
704
177k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
177k
    _common_profile->add_info_string("IsColocate",
706
177k
                                     std::to_string(_parent->is_colocated_operator()));
707
177k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
177k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
177k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
177k
    return Status::OK();
711
177k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
33
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
33
    _operator_profile =
654
33
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
33
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
33
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
33
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
33
    _operator_profile->add_child(_common_profile, true);
663
33
    _operator_profile->add_child(_custom_profile, true);
664
665
33
    _operator_profile->set_metadata(_parent->node_id());
666
33
    _wait_for_finish_dependency_timer =
667
33
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
33
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
33
    if constexpr (!is_fake_shared) {
670
33
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
33
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
33
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
33
            _shared_state = info.shared_state->template cast<SharedState>();
686
33
            _dependency = _shared_state->create_sink_dependency(
687
33
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
33
        }
689
33
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
33
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
33
    }
692
693
33
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
33
    _rows_input_counter =
698
33
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
33
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
33
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
33
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
33
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
33
    _memory_used_counter =
704
33
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
33
    _common_profile->add_info_string("IsColocate",
706
33
                                     std::to_string(_parent->is_colocated_operator()));
707
33
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
33
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
33
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
33
    return Status::OK();
711
33
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
5.39k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
5.39k
    _operator_profile =
654
5.39k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
5.39k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
5.39k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
5.39k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
5.39k
    _operator_profile->add_child(_common_profile, true);
663
5.39k
    _operator_profile->add_child(_custom_profile, true);
664
665
5.39k
    _operator_profile->set_metadata(_parent->node_id());
666
5.39k
    _wait_for_finish_dependency_timer =
667
5.39k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
5.39k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
5.39k
    if constexpr (!is_fake_shared) {
670
5.39k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
5.39k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
5.39k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
5.39k
            _shared_state = info.shared_state->template cast<SharedState>();
686
5.39k
            _dependency = _shared_state->create_sink_dependency(
687
5.39k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
5.39k
        }
689
5.39k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
5.39k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
5.39k
    }
692
693
5.39k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
5.39k
    _rows_input_counter =
698
5.39k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
5.39k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
5.39k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
5.39k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
5.39k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
5.39k
    _memory_used_counter =
704
5.39k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
5.39k
    _common_profile->add_info_string("IsColocate",
706
5.39k
                                     std::to_string(_parent->is_colocated_operator()));
707
5.39k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
5.39k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
5.39k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
5.39k
    return Status::OK();
711
5.39k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
8.71k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
8.71k
    _operator_profile =
654
8.71k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
8.71k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
8.71k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
8.71k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
8.71k
    _operator_profile->add_child(_common_profile, true);
663
8.71k
    _operator_profile->add_child(_custom_profile, true);
664
665
8.71k
    _operator_profile->set_metadata(_parent->node_id());
666
8.71k
    _wait_for_finish_dependency_timer =
667
8.71k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
8.71k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
8.71k
    if constexpr (!is_fake_shared) {
670
8.71k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
8.71k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
8.71k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
8.71k
            _shared_state = info.shared_state->template cast<SharedState>();
686
8.71k
            _dependency = _shared_state->create_sink_dependency(
687
8.71k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
8.71k
        }
689
8.71k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
8.71k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
8.71k
    }
692
693
8.71k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
8.71k
    _rows_input_counter =
698
8.71k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
8.71k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
8.71k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
8.71k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
8.71k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
8.71k
    _memory_used_counter =
704
8.71k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
8.71k
    _common_profile->add_info_string("IsColocate",
706
8.71k
                                     std::to_string(_parent->is_colocated_operator()));
707
8.71k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
8.71k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
8.71k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
8.71k
    return Status::OK();
711
8.71k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
84.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
84.3k
    _operator_profile =
654
84.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
84.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
84.3k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
84.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
84.3k
    _operator_profile->add_child(_common_profile, true);
663
84.3k
    _operator_profile->add_child(_custom_profile, true);
664
665
84.3k
    _operator_profile->set_metadata(_parent->node_id());
666
84.3k
    _wait_for_finish_dependency_timer =
667
84.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
84.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
84.3k
    if constexpr (!is_fake_shared) {
670
84.3k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
84.3k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
84.3k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
84.3k
            _shared_state = info.shared_state->template cast<SharedState>();
686
84.3k
            _dependency = _shared_state->create_sink_dependency(
687
84.3k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
84.3k
        }
689
84.3k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
84.3k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
84.3k
    }
692
693
84.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
84.3k
    _rows_input_counter =
698
84.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
84.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
84.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
84.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
84.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
84.3k
    _memory_used_counter =
704
84.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
84.3k
    _common_profile->add_info_string("IsColocate",
706
84.3k
                                     std::to_string(_parent->is_colocated_operator()));
707
84.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
84.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
84.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
84.3k
    return Status::OK();
711
84.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
60.6k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
60.6k
    _operator_profile =
654
60.6k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
60.6k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
60.6k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
60.6k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
60.6k
    _operator_profile->add_child(_common_profile, true);
663
60.6k
    _operator_profile->add_child(_custom_profile, true);
664
665
60.6k
    _operator_profile->set_metadata(_parent->node_id());
666
60.6k
    _wait_for_finish_dependency_timer =
667
60.6k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
60.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
60.6k
    if constexpr (!is_fake_shared) {
670
60.6k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
60.6k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
60.6k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
60.6k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
60.6k
                                                  ? 0
678
60.6k
                                                  : info.task_idx]
679
60.6k
                                  .get();
680
60.6k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
18.4E
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
686
18.4E
            _dependency = _shared_state->create_sink_dependency(
687
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
18.4E
        }
689
60.6k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
60.6k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
60.6k
    }
692
693
60.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
60.6k
    _rows_input_counter =
698
60.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
60.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
60.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
60.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
60.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
60.6k
    _memory_used_counter =
704
60.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
60.6k
    _common_profile->add_info_string("IsColocate",
706
60.6k
                                     std::to_string(_parent->is_colocated_operator()));
707
60.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
60.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
60.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
60.6k
    return Status::OK();
711
60.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
180
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
180
    _operator_profile =
654
180
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
180
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
180
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
180
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
180
    _operator_profile->add_child(_common_profile, true);
663
180
    _operator_profile->add_child(_custom_profile, true);
664
665
180
    _operator_profile->set_metadata(_parent->node_id());
666
180
    _wait_for_finish_dependency_timer =
667
180
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
180
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
180
    if constexpr (!is_fake_shared) {
670
180
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
180
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
180
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
180
            _shared_state = info.shared_state->template cast<SharedState>();
686
180
            _dependency = _shared_state->create_sink_dependency(
687
180
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
180
        }
689
180
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
180
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
180
    }
692
693
180
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
180
    _rows_input_counter =
698
180
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
180
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
180
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
180
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
180
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
180
    _memory_used_counter =
704
180
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
180
    _common_profile->add_info_string("IsColocate",
706
180
                                     std::to_string(_parent->is_colocated_operator()));
707
180
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
180
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
180
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
180
    return Status::OK();
711
180
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
425k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
425k
    _operator_profile =
654
425k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
425k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
425k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
425k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
425k
    _operator_profile->add_child(_common_profile, true);
663
425k
    _operator_profile->add_child(_custom_profile, true);
664
665
425k
    _operator_profile->set_metadata(_parent->node_id());
666
425k
    _wait_for_finish_dependency_timer =
667
425k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
425k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
    if constexpr (!is_fake_shared) {
670
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
                                                  ? 0
678
                                                  : info.task_idx]
679
                                  .get();
680
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
            _shared_state = info.shared_state->template cast<SharedState>();
686
            _dependency = _shared_state->create_sink_dependency(
687
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
        }
689
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
    }
692
693
425k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
425k
    _rows_input_counter =
698
425k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
425k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
425k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
425k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
425k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
425k
    _memory_used_counter =
704
425k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
425k
    _common_profile->add_info_string("IsColocate",
706
425k
                                     std::to_string(_parent->is_colocated_operator()));
707
425k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
425k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
425k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
425k
    return Status::OK();
711
425k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
4.83k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
4.83k
    _operator_profile =
654
4.83k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
4.83k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
4.83k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
4.83k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
4.83k
    _operator_profile->add_child(_common_profile, true);
663
4.83k
    _operator_profile->add_child(_custom_profile, true);
664
665
4.83k
    _operator_profile->set_metadata(_parent->node_id());
666
4.83k
    _wait_for_finish_dependency_timer =
667
4.83k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
4.83k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
4.83k
    if constexpr (!is_fake_shared) {
670
4.83k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
4.83k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
4.83k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
4.83k
            _shared_state = info.shared_state->template cast<SharedState>();
686
4.83k
            _dependency = _shared_state->create_sink_dependency(
687
4.83k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
4.83k
        }
689
4.83k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
4.83k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
4.83k
    }
692
693
4.83k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
4.83k
    _rows_input_counter =
698
4.83k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
4.83k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
4.83k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
4.83k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
4.83k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
4.83k
    _memory_used_counter =
704
4.83k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
4.83k
    _common_profile->add_info_string("IsColocate",
706
4.83k
                                     std::to_string(_parent->is_colocated_operator()));
707
4.83k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
4.83k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
4.83k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
4.83k
    return Status::OK();
711
4.83k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
473
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
473
    _operator_profile =
654
473
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
473
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
473
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
473
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
473
    _operator_profile->add_child(_common_profile, true);
663
473
    _operator_profile->add_child(_custom_profile, true);
664
665
473
    _operator_profile->set_metadata(_parent->node_id());
666
473
    _wait_for_finish_dependency_timer =
667
473
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
473
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
473
    if constexpr (!is_fake_shared) {
670
473
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
473
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
473
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
473
            _shared_state = info.shared_state->template cast<SharedState>();
686
473
            _dependency = _shared_state->create_sink_dependency(
687
473
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
473
        }
689
473
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
473
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
473
    }
692
693
473
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
473
    _rows_input_counter =
698
473
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
473
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
473
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
473
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
473
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
473
    _memory_used_counter =
704
473
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
473
    _common_profile->add_info_string("IsColocate",
706
473
                                     std::to_string(_parent->is_colocated_operator()));
707
473
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
473
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
473
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
473
    return Status::OK();
711
473
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
1.98k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
1.98k
    _operator_profile =
654
1.98k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
1.98k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
1.98k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
1.98k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
1.98k
    _operator_profile->add_child(_common_profile, true);
663
1.98k
    _operator_profile->add_child(_custom_profile, true);
664
665
1.98k
    _operator_profile->set_metadata(_parent->node_id());
666
1.98k
    _wait_for_finish_dependency_timer =
667
1.98k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
1.98k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
1.98k
    if constexpr (!is_fake_shared) {
670
1.98k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
1.98k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
1.98k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
1.98k
            _shared_state = info.shared_state->template cast<SharedState>();
686
1.98k
            _dependency = _shared_state->create_sink_dependency(
687
1.98k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
1.98k
        }
689
1.98k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
1.98k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
1.98k
    }
692
693
1.98k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
1.98k
    _rows_input_counter =
698
1.98k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
1.98k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
1.98k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
1.98k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
1.98k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
1.98k
    _memory_used_counter =
704
1.98k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
1.98k
    _common_profile->add_info_string("IsColocate",
706
1.98k
                                     std::to_string(_parent->is_colocated_operator()));
707
1.98k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
1.98k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
1.98k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
1.98k
    return Status::OK();
711
1.98k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
12.5k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
12.5k
    _operator_profile =
654
12.5k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
12.5k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
12.5k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
12.5k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
12.5k
    _operator_profile->add_child(_common_profile, true);
663
12.5k
    _operator_profile->add_child(_custom_profile, true);
664
665
12.5k
    _operator_profile->set_metadata(_parent->node_id());
666
12.5k
    _wait_for_finish_dependency_timer =
667
12.5k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
12.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
12.5k
    if constexpr (!is_fake_shared) {
670
12.5k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
12.5k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
12.5k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
12.5k
            _shared_state = info.shared_state->template cast<SharedState>();
686
12.5k
            _dependency = _shared_state->create_sink_dependency(
687
12.5k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
12.5k
        }
689
12.5k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
12.5k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
12.5k
    }
692
693
12.5k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
12.5k
    _rows_input_counter =
698
12.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
12.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
12.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
12.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
12.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
12.5k
    _memory_used_counter =
704
12.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
12.5k
    _common_profile->add_info_string("IsColocate",
706
12.5k
                                     std::to_string(_parent->is_colocated_operator()));
707
12.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
12.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
12.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
12.5k
    return Status::OK();
711
12.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
203k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
203k
    _operator_profile =
654
203k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
203k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
203k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
203k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
203k
    _operator_profile->add_child(_common_profile, true);
663
203k
    _operator_profile->add_child(_custom_profile, true);
664
665
203k
    _operator_profile->set_metadata(_parent->node_id());
666
203k
    _wait_for_finish_dependency_timer =
667
203k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
203k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
203k
    if constexpr (!is_fake_shared) {
670
203k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
204k
            info.shared_state_map.end()) {
672
204k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
204k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
204k
            }
675
204k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
204k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
204k
                                                  ? 0
678
204k
                                                  : info.task_idx]
679
204k
                                  .get();
680
204k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
18.4E
        } else {
682
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
18.4E
                DCHECK(false);
684
18.4E
            }
685
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
686
18.4E
            _dependency = _shared_state->create_sink_dependency(
687
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
18.4E
        }
689
203k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
203k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
203k
    }
692
693
203k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
203k
    _rows_input_counter =
698
203k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
203k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
203k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
203k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
203k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
203k
    _memory_used_counter =
704
203k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
203k
    _common_profile->add_info_string("IsColocate",
706
203k
                                     std::to_string(_parent->is_colocated_operator()));
707
203k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
203k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
203k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
203k
    return Status::OK();
711
203k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
368k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
368k
    _operator_profile =
654
368k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
368k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
368k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
368k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
368k
    _operator_profile->add_child(_common_profile, true);
663
368k
    _operator_profile->add_child(_custom_profile, true);
664
665
368k
    _operator_profile->set_metadata(_parent->node_id());
666
368k
    _wait_for_finish_dependency_timer =
667
368k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
368k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
368k
    if constexpr (!is_fake_shared) {
670
368k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
368k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
368k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
368k
            _shared_state = info.shared_state->template cast<SharedState>();
686
368k
            _dependency = _shared_state->create_sink_dependency(
687
368k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
368k
        }
689
368k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
368k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
368k
    }
692
693
368k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
368k
    _rows_input_counter =
698
368k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
368k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
368k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
368k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
368k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
368k
    _memory_used_counter =
704
368k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
368k
    _common_profile->add_info_string("IsColocate",
706
368k
                                     std::to_string(_parent->is_colocated_operator()));
707
368k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
368k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
368k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
368k
    return Status::OK();
711
368k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
25
    _operator_profile =
654
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
25
    _operator_profile->add_child(_common_profile, true);
663
25
    _operator_profile->add_child(_custom_profile, true);
664
665
25
    _operator_profile->set_metadata(_parent->node_id());
666
25
    _wait_for_finish_dependency_timer =
667
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
25
    if constexpr (!is_fake_shared) {
670
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
25
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
25
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
25
            _shared_state = info.shared_state->template cast<SharedState>();
686
25
            _dependency = _shared_state->create_sink_dependency(
687
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
25
        }
689
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
25
    }
692
693
25
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
25
    _rows_input_counter =
698
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
25
    _memory_used_counter =
704
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
25
    _common_profile->add_info_string("IsColocate",
706
25
                                     std::to_string(_parent->is_colocated_operator()));
707
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
25
    return Status::OK();
711
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
328
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
328
    _operator_profile =
654
328
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
328
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
328
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
328
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
328
    _operator_profile->add_child(_common_profile, true);
663
328
    _operator_profile->add_child(_custom_profile, true);
664
665
328
    _operator_profile->set_metadata(_parent->node_id());
666
328
    _wait_for_finish_dependency_timer =
667
328
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
328
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
328
    if constexpr (!is_fake_shared) {
670
328
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
328
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
328
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
328
            _shared_state = info.shared_state->template cast<SharedState>();
686
328
            _dependency = _shared_state->create_sink_dependency(
687
328
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
328
        }
689
328
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
328
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
328
    }
692
693
328
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
328
    _rows_input_counter =
698
328
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
328
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
328
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
328
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
328
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
328
    _memory_used_counter =
704
328
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
328
    _common_profile->add_info_string("IsColocate",
706
328
                                     std::to_string(_parent->is_colocated_operator()));
707
328
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
328
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
328
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
328
    return Status::OK();
711
328
}
712
713
template <typename SharedState>
714
1.47M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
1.47M
    if (_closed) {
716
2
        return Status::OK();
717
2
    }
718
1.47M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
1.04M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
1.04M
    }
721
1.47M
    _closed = true;
722
1.47M
    return Status::OK();
723
1.47M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
112k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
112k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
112k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
112k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
112k
    }
721
112k
    _closed = true;
722
112k
    return Status::OK();
723
112k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
1
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
1
    }
721
1
    _closed = true;
722
1
    return Status::OK();
723
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
177k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
177k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
177k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
177k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
177k
    }
721
177k
    _closed = true;
722
177k
    return Status::OK();
723
177k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
24
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
24
    if (_closed) {
716
2
        return Status::OK();
717
2
    }
718
22
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
22
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
22
    }
721
22
    _closed = true;
722
22
    return Status::OK();
723
24
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
5.38k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
5.38k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
5.38k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
5.38k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
5.38k
    }
721
5.38k
    _closed = true;
722
5.38k
    return Status::OK();
723
5.38k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
8.64k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
8.64k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
8.64k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
8.64k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
8.64k
    }
721
8.64k
    _closed = true;
722
8.64k
    return Status::OK();
723
8.64k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
84.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
84.0k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
84.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
84.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
84.0k
    }
721
84.0k
    _closed = true;
722
84.0k
    return Status::OK();
723
84.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
60.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
60.4k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
60.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
60.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
60.4k
    }
721
60.4k
    _closed = true;
722
60.4k
    return Status::OK();
723
60.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
168
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
168
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
168
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
168
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
168
    }
721
168
    _closed = true;
722
168
    return Status::OK();
723
168
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
428k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
428k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
    }
721
428k
    _closed = true;
722
428k
    return Status::OK();
723
428k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
4.82k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
4.82k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
4.82k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
4.82k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
4.82k
    }
721
4.82k
    _closed = true;
722
4.82k
    return Status::OK();
723
4.82k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
369
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
369
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
369
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
369
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
369
    }
721
369
    _closed = true;
722
369
    return Status::OK();
723
369
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
2.02k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
2.02k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
2.02k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
2.02k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
2.02k
    }
721
2.02k
    _closed = true;
722
2.02k
    return Status::OK();
723
2.02k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
12.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
12.6k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
12.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
12.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
12.6k
    }
721
12.6k
    _closed = true;
722
12.6k
    return Status::OK();
723
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
204k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
204k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
204k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
204k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
204k
    }
721
204k
    _closed = true;
722
204k
    return Status::OK();
723
204k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
369k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
369k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
369k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
369k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
369k
    }
721
369k
    _closed = true;
722
369k
    return Status::OK();
723
369k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
14
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
14
    }
721
14
    _closed = true;
722
14
    return Status::OK();
723
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
328
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
328
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
328
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
328
    }
721
328
    _closed = true;
722
328
    return Status::OK();
723
328
}
724
725
template <typename LocalStateType>
726
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
727
7.38k
                                                          bool* eos) {
728
7.38k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
7.37k
    return pull(state, block, eos);
730
7.38k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
727
32
                                                          bool* eos) {
728
32
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
32
    return pull(state, block, eos);
730
32
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
727
7.34k
                                                          bool* eos) {
728
7.34k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
7.34k
    return pull(state, block, eos);
730
7.34k
}
731
732
template <typename LocalStateType>
733
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
734
489k
                                                         bool* eos) {
735
489k
    auto& local_state = get_local_state(state);
736
489k
    if (need_more_input_data(state)) {
737
459k
        local_state._child_block->clear_column_data(
738
459k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
459k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
459k
                state, local_state._child_block.get(), &local_state._child_eos));
741
459k
        *eos = local_state._child_eos;
742
459k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
80.5k
            return Status::OK();
744
80.5k
        }
745
378k
        {
746
378k
            SCOPED_TIMER(local_state.exec_time_counter());
747
378k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
378k
        }
749
378k
    }
750
751
409k
    if (!need_more_input_data(state)) {
752
384k
        SCOPED_TIMER(local_state.exec_time_counter());
753
384k
        bool new_eos = false;
754
384k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
384k
        if (new_eos) {
756
303k
            *eos = true;
757
303k
        } else if (!need_more_input_data(state)) {
758
24.9k
            *eos = false;
759
24.9k
        }
760
384k
    }
761
409k
    return Status::OK();
762
409k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
139k
                                                         bool* eos) {
735
139k
    auto& local_state = get_local_state(state);
736
139k
    if (need_more_input_data(state)) {
737
121k
        local_state._child_block->clear_column_data(
738
121k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
121k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
121k
                state, local_state._child_block.get(), &local_state._child_eos));
741
121k
        *eos = local_state._child_eos;
742
121k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
38.8k
            return Status::OK();
744
38.8k
        }
745
83.0k
        {
746
83.0k
            SCOPED_TIMER(local_state.exec_time_counter());
747
83.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
83.0k
        }
749
83.0k
    }
750
751
100k
    if (!need_more_input_data(state)) {
752
100k
        SCOPED_TIMER(local_state.exec_time_counter());
753
100k
        bool new_eos = false;
754
100k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
100k
        if (new_eos) {
756
39.7k
            *eos = true;
757
60.5k
        } else if (!need_more_input_data(state)) {
758
10.7k
            *eos = false;
759
10.7k
        }
760
100k
    }
761
100k
    return Status::OK();
762
100k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
4.26k
                                                         bool* eos) {
735
4.26k
    auto& local_state = get_local_state(state);
736
4.26k
    if (need_more_input_data(state)) {
737
2.51k
        local_state._child_block->clear_column_data(
738
2.51k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
2.51k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
2.51k
                state, local_state._child_block.get(), &local_state._child_eos));
741
2.51k
        *eos = local_state._child_eos;
742
2.51k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
528
            return Status::OK();
744
528
        }
745
1.98k
        {
746
1.98k
            SCOPED_TIMER(local_state.exec_time_counter());
747
1.98k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
1.98k
        }
749
1.98k
    }
750
751
3.74k
    if (!need_more_input_data(state)) {
752
3.74k
        SCOPED_TIMER(local_state.exec_time_counter());
753
3.74k
        bool new_eos = false;
754
3.74k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
3.74k
        if (new_eos) {
756
1.47k
            *eos = true;
757
2.26k
        } else if (!need_more_input_data(state)) {
758
1.73k
            *eos = false;
759
1.73k
        }
760
3.74k
    }
761
3.73k
    return Status::OK();
762
3.73k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
1.88k
                                                         bool* eos) {
735
1.88k
    auto& local_state = get_local_state(state);
736
1.88k
    if (need_more_input_data(state)) {
737
1.88k
        local_state._child_block->clear_column_data(
738
1.88k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
1.88k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
1.88k
                state, local_state._child_block.get(), &local_state._child_eos));
741
1.88k
        *eos = local_state._child_eos;
742
1.88k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
760
            return Status::OK();
744
760
        }
745
1.12k
        {
746
1.12k
            SCOPED_TIMER(local_state.exec_time_counter());
747
1.12k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
1.12k
        }
749
1.12k
    }
750
751
1.12k
    if (!need_more_input_data(state)) {
752
1.12k
        SCOPED_TIMER(local_state.exec_time_counter());
753
1.12k
        bool new_eos = false;
754
1.12k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
1.12k
        if (new_eos) {
756
778
            *eos = true;
757
778
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
1.12k
    }
761
1.12k
    return Status::OK();
762
1.12k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
18.3k
                                                         bool* eos) {
735
18.3k
    auto& local_state = get_local_state(state);
736
18.3k
    if (need_more_input_data(state)) {
737
18.2k
        local_state._child_block->clear_column_data(
738
18.2k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
18.2k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
18.2k
                state, local_state._child_block.get(), &local_state._child_eos));
741
18.2k
        *eos = local_state._child_eos;
742
18.2k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
6.20k
            return Status::OK();
744
6.20k
        }
745
12.0k
        {
746
12.0k
            SCOPED_TIMER(local_state.exec_time_counter());
747
12.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
12.0k
        }
749
12.0k
    }
750
751
12.1k
    if (!need_more_input_data(state)) {
752
6.14k
        SCOPED_TIMER(local_state.exec_time_counter());
753
6.14k
        bool new_eos = false;
754
6.14k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
6.14k
        if (new_eos) {
756
6.04k
            *eos = true;
757
6.04k
        } else if (!need_more_input_data(state)) {
758
18
            *eos = false;
759
18
        }
760
6.14k
    }
761
12.1k
    return Status::OK();
762
12.1k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
297k
                                                         bool* eos) {
735
297k
    auto& local_state = get_local_state(state);
736
298k
    if (need_more_input_data(state)) {
737
298k
        local_state._child_block->clear_column_data(
738
298k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
298k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
298k
                state, local_state._child_block.get(), &local_state._child_eos));
741
298k
        *eos = local_state._child_eos;
742
298k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
32.4k
            return Status::OK();
744
32.4k
        }
745
265k
        {
746
265k
            SCOPED_TIMER(local_state.exec_time_counter());
747
265k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
265k
        }
749
265k
    }
750
751
265k
    if (!need_more_input_data(state)) {
752
247k
        SCOPED_TIMER(local_state.exec_time_counter());
753
247k
        bool new_eos = false;
754
247k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
247k
        if (new_eos) {
756
246k
            *eos = true;
757
246k
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
247k
    }
761
265k
    return Status::OK();
762
265k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
22.0k
                                                         bool* eos) {
735
22.0k
    auto& local_state = get_local_state(state);
736
22.0k
    if (need_more_input_data(state)) {
737
10.0k
        local_state._child_block->clear_column_data(
738
10.0k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
10.0k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
10.0k
                state, local_state._child_block.get(), &local_state._child_eos));
741
10.0k
        *eos = local_state._child_eos;
742
10.0k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
750
            return Status::OK();
744
750
        }
745
9.26k
        {
746
9.26k
            SCOPED_TIMER(local_state.exec_time_counter());
747
9.26k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
9.26k
        }
749
9.26k
    }
750
751
21.3k
    if (!need_more_input_data(state)) {
752
20.7k
        SCOPED_TIMER(local_state.exec_time_counter());
753
20.7k
        bool new_eos = false;
754
20.7k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
20.7k
        if (new_eos) {
756
5.38k
            *eos = true;
757
15.3k
        } else if (!need_more_input_data(state)) {
758
12.0k
            *eos = false;
759
12.0k
        }
760
20.7k
    }
761
21.3k
    return Status::OK();
762
21.3k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
6.56k
                                                         bool* eos) {
735
6.56k
    auto& local_state = get_local_state(state);
736
6.56k
    if (need_more_input_data(state)) {
737
6.20k
        local_state._child_block->clear_column_data(
738
6.20k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
6.20k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
6.20k
                state, local_state._child_block.get(), &local_state._child_eos));
741
6.20k
        *eos = local_state._child_eos;
742
6.20k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
939
            return Status::OK();
744
939
        }
745
5.26k
        {
746
5.26k
            SCOPED_TIMER(local_state.exec_time_counter());
747
5.26k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
5.26k
        }
749
5.26k
    }
750
751
5.62k
    if (!need_more_input_data(state)) {
752
5.62k
        SCOPED_TIMER(local_state.exec_time_counter());
753
5.62k
        bool new_eos = false;
754
5.62k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
5.62k
        if (new_eos) {
756
3.55k
            *eos = true;
757
3.55k
        } else if (!need_more_input_data(state)) {
758
366
            *eos = false;
759
366
        }
760
5.62k
    }
761
5.61k
    return Status::OK();
762
5.61k
}
763
764
template <typename Writer, typename Parent>
765
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
766
42.9k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
42.9k
    RETURN_IF_ERROR(Base::init(state, info));
768
42.9k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
42.9k
                                                         "AsyncWriterDependency", true);
770
42.9k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
42.9k
                             _finish_dependency));
772
773
42.9k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
42.9k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
42.9k
    return Status::OK();
776
42.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
357
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
357
    RETURN_IF_ERROR(Base::init(state, info));
768
357
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
357
                                                         "AsyncWriterDependency", true);
770
357
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
357
                             _finish_dependency));
772
773
357
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
357
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
357
    return Status::OK();
776
357
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
42.5k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
42.5k
    RETURN_IF_ERROR(Base::init(state, info));
768
42.5k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
42.5k
                                                         "AsyncWriterDependency", true);
770
42.5k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
42.5k
                             _finish_dependency));
772
773
42.5k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
42.5k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
42.5k
    return Status::OK();
776
42.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
56
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
56
    RETURN_IF_ERROR(Base::init(state, info));
768
56
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
56
                                                         "AsyncWriterDependency", true);
770
56
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
56
                             _finish_dependency));
772
773
56
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
56
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
56
    return Status::OK();
776
56
}
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
777
778
template <typename Writer, typename Parent>
779
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
780
43.3k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
43.3k
    RETURN_IF_ERROR(Base::open(state));
782
43.3k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
337k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
293k
        RETURN_IF_ERROR(
785
293k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
293k
    }
787
43.3k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
43.3k
    return Status::OK();
789
43.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
356
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
356
    RETURN_IF_ERROR(Base::open(state));
782
356
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
1.84k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
1.49k
        RETURN_IF_ERROR(
785
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
1.49k
    }
787
356
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
356
    return Status::OK();
789
356
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
42.9k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
42.9k
    RETURN_IF_ERROR(Base::open(state));
782
42.9k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
334k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
291k
        RETURN_IF_ERROR(
785
291k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
291k
    }
787
42.9k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
42.9k
    return Status::OK();
789
42.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
56
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
56
    RETURN_IF_ERROR(Base::open(state));
782
56
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
1.00k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
952
        RETURN_IF_ERROR(
785
952
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
952
    }
787
56
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
56
    return Status::OK();
789
56
}
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
790
791
template <typename Writer, typename Parent>
792
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
793
58.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
58.0k
    return _writer->sink(block, eos);
795
58.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
1.28k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
1.28k
    return _writer->sink(block, eos);
795
1.28k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
56.6k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
56.6k
    return _writer->sink(block, eos);
795
56.6k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
56
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
56
    return _writer->sink(block, eos);
795
56
}
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
796
797
template <typename Writer, typename Parent>
798
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
799
43.4k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
43.4k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
43.4k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
43.4k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
43.4k
    if (_writer) {
807
43.4k
        Status st = _writer->get_writer_status();
808
43.4k
        if (exec_status.ok()) {
809
43.3k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
43.3k
                                                       : Status::Cancelled("force close"));
811
43.3k
        } else {
812
80
            _writer->force_close(exec_status);
813
80
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
43.4k
        RETURN_IF_ERROR(st);
818
43.4k
    }
819
43.3k
    return Base::close(state, exec_status);
820
43.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
345
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
345
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
345
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
345
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
345
    if (_writer) {
807
345
        Status st = _writer->get_writer_status();
808
345
        if (exec_status.ok()) {
809
345
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
345
                                                       : Status::Cancelled("force close"));
811
345
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
345
        RETURN_IF_ERROR(st);
818
345
    }
819
345
    return Base::close(state, exec_status);
820
345
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
43.0k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
43.0k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
43.0k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
43.0k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
43.0k
    if (_writer) {
807
43.0k
        Status st = _writer->get_writer_status();
808
43.0k
        if (exec_status.ok()) {
809
42.9k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
42.9k
                                                       : Status::Cancelled("force close"));
811
42.9k
        } else {
812
80
            _writer->force_close(exec_status);
813
80
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
43.0k
        RETURN_IF_ERROR(st);
818
43.0k
    }
819
42.9k
    return Base::close(state, exec_status);
820
43.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
56
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
56
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
56
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
56
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
56
    if (_writer) {
807
56
        Status st = _writer->get_writer_status();
808
56
        if (exec_status.ok()) {
809
56
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
56
                                                       : Status::Cancelled("force close"));
811
56
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
56
        RETURN_IF_ERROR(st);
818
56
    }
819
56
    return Base::close(state, exec_status);
820
56
}
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
821
822
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
823
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
824
DECLARE_OPERATOR(ResultSinkLocalState)
825
DECLARE_OPERATOR(JdbcTableSinkLocalState)
826
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
827
DECLARE_OPERATOR(ResultFileSinkLocalState)
828
DECLARE_OPERATOR(OlapTableSinkLocalState)
829
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
830
DECLARE_OPERATOR(HiveTableSinkLocalState)
831
DECLARE_OPERATOR(TVFTableSinkLocalState)
832
DECLARE_OPERATOR(IcebergTableSinkLocalState)
833
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
834
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
835
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
836
DECLARE_OPERATOR(MCTableSinkLocalState)
837
DECLARE_OPERATOR(AnalyticSinkLocalState)
838
DECLARE_OPERATOR(BlackholeSinkLocalState)
839
DECLARE_OPERATOR(SortSinkLocalState)
840
DECLARE_OPERATOR(SpillSortSinkLocalState)
841
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
842
DECLARE_OPERATOR(AggSinkLocalState)
843
DECLARE_OPERATOR(BucketedAggSinkLocalState)
844
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
845
DECLARE_OPERATOR(ExchangeSinkLocalState)
846
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
847
DECLARE_OPERATOR(UnionSinkLocalState)
848
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
849
DECLARE_OPERATOR(PartitionSortSinkLocalState)
850
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
851
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
852
DECLARE_OPERATOR(SetSinkLocalState<true>)
853
DECLARE_OPERATOR(SetSinkLocalState<false>)
854
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
855
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
856
DECLARE_OPERATOR(CacheSinkLocalState)
857
DECLARE_OPERATOR(DictSinkLocalState)
858
DECLARE_OPERATOR(RecCTESinkLocalState)
859
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
860
861
#undef DECLARE_OPERATOR
862
863
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
864
DECLARE_OPERATOR(HashJoinProbeLocalState)
865
DECLARE_OPERATOR(OlapScanLocalState)
866
DECLARE_OPERATOR(GroupCommitLocalState)
867
DECLARE_OPERATOR(JDBCScanLocalState)
868
DECLARE_OPERATOR(FileScanLocalState)
869
DECLARE_OPERATOR(AnalyticLocalState)
870
DECLARE_OPERATOR(SortLocalState)
871
DECLARE_OPERATOR(SpillSortLocalState)
872
DECLARE_OPERATOR(LocalMergeSortLocalState)
873
DECLARE_OPERATOR(AggLocalState)
874
DECLARE_OPERATOR(BucketedAggLocalState)
875
DECLARE_OPERATOR(PartitionedAggLocalState)
876
DECLARE_OPERATOR(TableFunctionLocalState)
877
DECLARE_OPERATOR(ExchangeLocalState)
878
DECLARE_OPERATOR(RepeatLocalState)
879
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
880
DECLARE_OPERATOR(AssertNumRowsLocalState)
881
DECLARE_OPERATOR(EmptySetLocalState)
882
DECLARE_OPERATOR(UnionSourceLocalState)
883
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
884
DECLARE_OPERATOR(PartitionSortSourceLocalState)
885
DECLARE_OPERATOR(SetSourceLocalState<true>)
886
DECLARE_OPERATOR(SetSourceLocalState<false>)
887
DECLARE_OPERATOR(DataGenLocalState)
888
DECLARE_OPERATOR(SchemaScanLocalState)
889
DECLARE_OPERATOR(MetaScanLocalState)
890
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
891
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
892
DECLARE_OPERATOR(CacheSourceLocalState)
893
DECLARE_OPERATOR(RecCTESourceLocalState)
894
DECLARE_OPERATOR(RecCTEScanLocalState)
895
896
#ifdef BE_TEST
897
DECLARE_OPERATOR(MockLocalState)
898
DECLARE_OPERATOR(MockScanLocalState)
899
#endif
900
#undef DECLARE_OPERATOR
901
902
template class StreamingOperatorX<AssertNumRowsLocalState>;
903
template class StreamingOperatorX<SelectLocalState>;
904
905
template class StatefulOperatorX<HashJoinProbeLocalState>;
906
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
907
template class StatefulOperatorX<RepeatLocalState>;
908
template class StatefulOperatorX<MaterializationLocalState>;
909
template class StatefulOperatorX<StreamingAggLocalState>;
910
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
911
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
912
template class StatefulOperatorX<TableFunctionLocalState>;
913
914
template class PipelineXSinkLocalState<HashJoinSharedState>;
915
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
916
template class PipelineXSinkLocalState<SortSharedState>;
917
template class PipelineXSinkLocalState<SpillSortSharedState>;
918
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
919
template class PipelineXSinkLocalState<AnalyticSharedState>;
920
template class PipelineXSinkLocalState<AggSharedState>;
921
template class PipelineXSinkLocalState<BucketedAggSharedState>;
922
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
923
template class PipelineXSinkLocalState<FakeSharedState>;
924
template class PipelineXSinkLocalState<UnionSharedState>;
925
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
926
template class PipelineXSinkLocalState<MultiCastSharedState>;
927
template class PipelineXSinkLocalState<SetSharedState>;
928
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
929
template class PipelineXSinkLocalState<BasicSharedState>;
930
template class PipelineXSinkLocalState<DataQueueSharedState>;
931
template class PipelineXSinkLocalState<RecCTESharedState>;
932
933
template class PipelineXLocalState<HashJoinSharedState>;
934
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
935
template class PipelineXLocalState<SortSharedState>;
936
template class PipelineXLocalState<SpillSortSharedState>;
937
template class PipelineXLocalState<NestedLoopJoinSharedState>;
938
template class PipelineXLocalState<AnalyticSharedState>;
939
template class PipelineXLocalState<AggSharedState>;
940
template class PipelineXLocalState<BucketedAggSharedState>;
941
template class PipelineXLocalState<PartitionedAggSharedState>;
942
template class PipelineXLocalState<FakeSharedState>;
943
template class PipelineXLocalState<UnionSharedState>;
944
template class PipelineXLocalState<DataQueueSharedState>;
945
template class PipelineXLocalState<MultiCastSharedState>;
946
template class PipelineXLocalState<PartitionSortNodeSharedState>;
947
template class PipelineXLocalState<SetSharedState>;
948
template class PipelineXLocalState<LocalExchangeSharedState>;
949
template class PipelineXLocalState<BasicSharedState>;
950
template class PipelineXLocalState<RecCTESharedState>;
951
952
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
953
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
954
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
955
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
956
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
957
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
958
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
959
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
960
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
961
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
962
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
963
964
#ifdef BE_TEST
965
template class OperatorX<DummyOperatorLocalState>;
966
template class DataSinkOperatorX<DummySinkLocalState>;
967
#endif
968
969
} // namespace doris