Coverage Report

Created: 2026-09-15 16:29

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.74M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.74M
    if (_parent->nereids_id() == -1) {
122
910k
        return fmt::format("(id={})", _parent->node_id());
123
910k
    } else {
124
835k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
835k
    }
126
1.74M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
66.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
66.4k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
66.4k
    } else {
124
66.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
66.4k
    }
126
66.4k
}
_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
192k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
192k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
192k
    } else {
124
192k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
192k
    }
126
192k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
22
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
22
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
22
    } else {
124
22
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
22
    }
126
22
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.98k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.98k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.98k
    } else {
124
5.98k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.98k
    }
126
5.98k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
7.77k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
7.77k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
7.75k
    } else {
124
7.75k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7.75k
    }
126
7.77k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
89.2k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
89.2k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
89.2k
    } else {
124
89.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
89.2k
    }
126
89.2k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
104k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
104k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
104k
    } else {
124
104k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
104k
    }
126
104k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
106
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
106
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
106
    } else {
124
106
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
106
    }
126
106
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
584k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
584k
    if (_parent->nereids_id() == -1) {
122
275k
        return fmt::format("(id={})", _parent->node_id());
123
309k
    } else {
124
309k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
309k
    }
126
584k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.1k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.1k
    } else {
124
54.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.1k
    }
126
54.1k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.63k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.63k
    if (_parent->nereids_id() == -1) {
122
5.63k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
5.63k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
426
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
426
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
324
    } else {
124
324
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
324
    }
126
426
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.11k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.11k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.10k
    } else {
124
5.10k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.10k
    }
126
5.11k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
629k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
629k
    if (_parent->nereids_id() == -1) {
122
629k
        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
629k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
169
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
169
    } else {
124
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
169
    }
126
169
}
127
128
template <typename SharedStateArg>
129
1.22M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.22M
    if (_parent->nereids_id() == -1) {
131
691k
        return fmt::format("(id={})", _parent->node_id());
132
691k
    } else {
133
529k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
529k
    }
135
1.22M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
114k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
114k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
114k
    } else {
133
114k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
114k
    }
135
114k
}
_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
195k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
195k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
195k
    } else {
133
195k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
195k
    }
135
195k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
29
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
29
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
29
    } else {
133
29
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
29
    }
135
29
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.99k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.99k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.99k
    } else {
133
5.99k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.99k
    }
135
5.99k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.77k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.77k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
7.76k
    } else {
133
7.76k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.76k
    }
135
7.77k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
89.6k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
89.6k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
89.6k
    } else {
133
89.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
89.6k
    }
135
89.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
103k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
103k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
103k
    } else {
133
103k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
103k
    }
135
103k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
116
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
116
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
116
    } else {
133
116
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
116
    }
135
116
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
18
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
18
    if (_parent->nereids_id() == -1) {
131
18
        return fmt::format("(id={})", _parent->node_id());
132
18
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
11.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
11.4k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
11.4k
    } else {
133
11.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
11.4k
    }
135
11.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
426
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
426
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
324
    } else {
133
324
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
324
    }
135
426
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.5k
    if (_parent->nereids_id() == -1) {
131
12.5k
        return fmt::format("(id={})", _parent->node_id());
132
12.5k
    } else {
133
16
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
16
    }
135
12.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
237k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
238k
    if (_parent->nereids_id() == -1) {
131
238k
        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
237k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
440k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
440k
    if (_parent->nereids_id() == -1) {
131
440k
        return fmt::format("(id={})", _parent->node_id());
132
440k
    } else {
133
58
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
58
    }
135
440k
}
_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
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
338
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
338
    } else {
133
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
338
    }
135
338
}
136
137
template <typename SharedStateArg>
138
34.7k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
34.7k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
34.7k
    _terminated = true;
143
34.7k
    return Status::OK();
144
34.7k
}
_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
6.11k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
6.11k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
6.11k
    _terminated = true;
143
6.11k
    return Status::OK();
144
6.11k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.79k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.79k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.79k
    _terminated = true;
143
1.79k
    return Status::OK();
144
1.79k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.14k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.14k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.14k
    _terminated = true;
143
1.14k
    return Status::OK();
144
1.14k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
510
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
510
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
510
    _terminated = true;
143
510
    return Status::OK();
144
510
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
436
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
436
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
436
    _terminated = true;
143
436
    return Status::OK();
144
436
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
5
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
5
    _terminated = true;
143
5
    return Status::OK();
144
5
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
224
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
224
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
224
    _terminated = true;
143
224
    return Status::OK();
144
224
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
13
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
13
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
13
    _terminated = true;
143
13
    return Status::OK();
144
13
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
358
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
358
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
358
    _terminated = true;
143
358
    return Status::OK();
144
358
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
129
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
129
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
129
    _terminated = true;
143
129
    return Status::OK();
144
129
}
145
146
299k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
299k
    return _child && _child->is_serial_operator() && !is_source()
148
299k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
299k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
299k
}
151
152
23.6k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
23.6k
    if (!_child) {
154
22.4k
        return false;
155
22.4k
    }
156
1.17k
    if (_child->is_serial_operator()) {
157
138
        return true;
158
138
    }
159
1.03k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.03k
    return child_distribution.need_local_exchange() &&
161
1.03k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.17k
}
163
164
template <typename SharedStateArg>
165
19.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.5k
    fmt::memory_buffer debug_string_buffer;
167
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.5k
    return fmt::to_string(debug_string_buffer);
169
19.5k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
19.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.5k
    fmt::memory_buffer debug_string_buffer;
167
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.5k
    return fmt::to_string(debug_string_buffer);
169
19.5k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
19.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.5k
    fmt::memory_buffer debug_string_buffer;
174
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.5k
    return fmt::to_string(debug_string_buffer);
176
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
172
19.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.5k
    fmt::memory_buffer debug_string_buffer;
174
19.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.5k
    return fmt::to_string(debug_string_buffer);
176
19.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
19.6k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
19.6k
    fmt::memory_buffer debug_string_buffer;
180
19.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
19.6k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
19.6k
                   _is_serial_operator);
183
19.6k
    return fmt::to_string(debug_string_buffer);
184
19.6k
}
185
186
19.5k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
19.5k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
19.5k
}
189
190
640k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
640k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
640k
    _nereids_id = tnode.nereids_id;
193
640k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.86k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.86k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.86k
            tnode.intermediate_projections_list.size()) {
199
0
            return Status::InternalError(
200
0
                    "intermediate_output_tuple_id_list size:{} not match "
201
0
                    "intermediate_projections_list size:{}",
202
0
                    tnode.intermediate_output_tuple_id_list.size(),
203
0
                    tnode.intermediate_projections_list.size());
204
0
        }
205
3.86k
    }
206
640k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
640k
    _op_name = substr + "_OPERATOR";
208
209
640k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
640k
    } else if (tnode.__isset.conjuncts) {
212
272k
        for (const auto& conjunct : tnode.conjuncts) {
213
272k
            VExprContextSPtr context;
214
272k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
272k
            _conjuncts.emplace_back(context);
216
272k
        }
217
99.1k
    }
218
219
    // create the projections expr
220
640k
    if (tnode.__isset.projections) {
221
260k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
260k
    }
223
640k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.86k
        DCHECK(has_projection()) << "no final projections";
225
3.86k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.53k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.53k
            VExprContextSPtrs projections;
228
6.53k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.53k
            _projection->intermediate_projections.push_back(projections);
230
6.53k
        }
231
3.86k
    }
232
640k
    return Status::OK();
233
640k
}
234
235
668k
Status OperatorXBase::prepare(RuntimeState* state) {
236
668k
    for (auto& conjunct : _conjuncts) {
237
272k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
272k
    }
239
668k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
618k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
339k
            return a->execute_cost() < b->execute_cost();
242
339k
        });
243
618k
    };
244
245
668k
    if (has_projection()) {
246
259k
        auto& projection = *_projection;
247
266k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.54k
            const auto& input_row_desc =
249
6.54k
                    i == 0 ? operator_row_desc_before_projection()
250
6.54k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.54k
            RETURN_IF_ERROR(
252
6.54k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.54k
        }
254
259k
        const auto& final_projection_input_row_desc =
255
259k
                projection.intermediate_output_row_descriptors.empty()
256
259k
                        ? operator_row_desc_before_projection()
257
259k
                        : projection.intermediate_output_row_descriptors.back();
258
259k
        RETURN_IF_ERROR(
259
259k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
259k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
259k
                                                      projection.output_row_descriptor));
262
259k
    }
263
264
668k
    for (auto& conjunct : _conjuncts) {
265
272k
        RETURN_IF_ERROR(conjunct->open(state));
266
272k
    }
267
668k
    if (has_projection()) {
268
259k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
259k
        for (auto& projections : _projection->intermediate_projections) {
270
6.53k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.53k
        }
272
259k
    }
273
668k
    if (_child && !is_source()) {
274
89.8k
        RETURN_IF_ERROR(_child->prepare(state));
275
89.8k
    }
276
277
668k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
668k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
668k
    return Status::OK();
283
668k
}
284
285
11.6k
Status OperatorXBase::terminate(RuntimeState* state) {
286
11.6k
    if (_child && !is_source()) {
287
867
        RETURN_IF_ERROR(_child->terminate(state));
288
867
    }
289
11.6k
    auto result = state->get_local_state_result(operator_id());
290
11.6k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
11.6k
    return result.value()->terminate(state);
294
11.6k
}
295
296
4.68M
Status OperatorXBase::close(RuntimeState* state) {
297
4.68M
    if (_child && !is_source()) {
298
738k
        RETURN_IF_ERROR(_child->close(state));
299
738k
    }
300
4.68M
    auto result = state->get_local_state_result(operator_id());
301
4.68M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.68M
    return result.value()->close(state);
305
4.68M
}
306
307
269k
void PipelineXLocalStateBase::clear_origin_block() {
308
269k
    _origin_block.clear_column_data(
309
269k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
269k
}
311
312
987k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
987k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
987k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
987k
    return Status::OK();
317
987k
}
318
319
0
bool PipelineXLocalStateBase::is_blockable() const {
320
0
    return std::any_of(_projections.begin(), _projections.end(),
321
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
322
0
}
323
324
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
325
269k
                                     Block* output_block) const {
326
269k
    auto* local_state = state->get_local_state(operator_id());
327
269k
    SCOPED_TIMER(local_state->exec_time_counter());
328
269k
    SCOPED_TIMER(local_state->_projection_timer);
329
269k
    const size_t rows = origin_block->rows();
330
269k
    if (rows == 0) {
331
141k
        return Status::OK();
332
141k
    }
333
128k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
128k
    {
336
128k
        Block input_block = *origin_block;
337
338
128k
        ColumnsWithTypeAndName new_columns;
339
128k
        for (const auto& projections : local_state->_intermediate_projections) {
340
4.15k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
4.15k
            new_columns.resize(projections.size());
345
73.2k
            for (int i = 0; i < projections.size(); i++) {
346
69.1k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
69.1k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
69.1k
            }
355
4.14k
            Block tmp_block {new_columns};
356
4.14k
            input_block.swap(tmp_block);
357
4.14k
        }
358
359
128k
        if (input_block.rows() != rows) {
360
0
            return Status::InternalError(
361
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
362
0
                    "input_block: {}",
363
0
                    input_block.rows(), rows, input_block.dump_structure());
364
0
        }
365
366
128k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
128k
                output_block, _projection->output_row_descriptor);
368
128k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
128k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
128k
        Columns shared_columns(mutable_columns.size());
371
372
745k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
617k
            ColumnPtr column_ptr;
374
617k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
617k
            if (column_ptr->size() != rows) {
376
0
                return Status::InternalError(
377
0
                        "projection result column size {} not equal input rows {}, expr: {}",
378
0
                        column_ptr->size(), rows,
379
0
                        local_state->_projections[i]->root()->debug_string());
380
0
            }
381
617k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
617k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
617k
            if (column_ptr->is_exclusive()) {
386
225k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
391k
            } else {
388
391k
                shared_columns[i] = std::move(column_ptr);
389
391k
            }
390
617k
        }
391
392
128k
        scoped_mutable_block.restore();
393
745k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
617k
            if (shared_columns[i]) {
395
391k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
391k
            }
397
617k
        }
398
128k
    }
399
400
0
    origin_block->clear_column_data(
401
128k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
128k
    DCHECK_EQ(output_block->rows(), rows);
403
404
128k
    return Status::OK();
405
128k
}
406
407
4.44M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.44M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.44M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.44M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.44M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.44M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.44M
            if (_debug_point_count++ % 2 == 0) {
414
4.44M
                return Status::OK();
415
4.44M
            }
416
4.44M
        }
417
4.44M
    });
418
419
4.44M
    Status status;
420
4.44M
    auto* local_state = state->get_local_state(operator_id());
421
4.44M
    Defer defer([&]() {
422
4.45M
        if (status.ok()) {
423
4.45M
            local_state->update_output_block_counters(*block);
424
4.45M
        }
425
4.44M
    });
426
4.44M
    if (has_projection()) {
427
269k
        local_state->clear_origin_block();
428
269k
        status = get_block(state, &local_state->_origin_block, eos);
429
269k
        if (UNLIKELY(!status.ok())) {
430
25
            return status;
431
25
        }
432
269k
        status = do_projections(state, &local_state->_origin_block, block);
433
269k
        return status;
434
269k
    }
435
4.18M
    status = get_block(state, block, eos);
436
4.18M
    RETURN_IF_ERROR(block->check_type_and_column());
437
4.18M
    return status;
438
4.18M
}
439
440
2.85M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.85M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.58k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.58k
        *eos = true;
444
9.58k
    }
445
446
2.85M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.85M
        auto op_name = to_lower(_parent->_op_name);
448
2.85M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.85M
        arg_op_name = to_lower(arg_op_name);
450
451
2.85M
        if (op_name == arg_op_name) {
452
2.85M
            *eos = true;
453
2.85M
        }
454
2.85M
    });
455
456
2.85M
    if (auto rows = block->rows()) {
457
695k
        _num_rows_returned += rows;
458
695k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
695k
    }
460
2.85M
}
461
462
34.7k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
34.7k
    auto result = state->get_sink_local_state_result();
464
34.7k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
34.7k
    return result.value()->terminate(state);
468
34.7k
}
469
470
19.5k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
19.5k
    fmt::memory_buffer debug_string_buffer;
472
473
19.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
19.5k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
19.5k
    return fmt::to_string(debug_string_buffer);
476
19.5k
}
477
478
19.5k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
19.5k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
19.5k
}
481
482
335k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
335k
    std::string op_name = "UNKNOWN_SINK";
484
335k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
336k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
336k
        op_name = it->second;
488
336k
    }
489
335k
    _name = op_name + "_OPERATOR";
490
335k
    return Status::OK();
491
335k
}
492
493
289k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
289k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
289k
    _nereids_id = tnode.nereids_id;
496
289k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
289k
    _name = substr + "_SINK_OPERATOR";
498
289k
    return Status::OK();
499
289k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.70M
                                                            LocalSinkStateInfo& info) {
504
1.70M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.70M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.70M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.70M
    return Status::OK();
508
1.70M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
114k
                                                            LocalSinkStateInfo& info) {
504
114k
    auto local_state = LocalStateType::create_unique(this, state);
505
114k
    RETURN_IF_ERROR(local_state->init(state, info));
506
114k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
114k
    return Status::OK();
508
114k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
395k
                                                            LocalSinkStateInfo& info) {
504
395k
    auto local_state = LocalStateType::create_unique(this, state);
505
395k
    RETURN_IF_ERROR(local_state->init(state, info));
506
395k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
395k
    return Status::OK();
508
395k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
3
                                                            LocalSinkStateInfo& info) {
504
3
    auto local_state = LocalStateType::create_unique(this, state);
505
3
    RETURN_IF_ERROR(local_state->init(state, info));
506
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
3
    return Status::OK();
508
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
355
                                                            LocalSinkStateInfo& info) {
504
355
    auto local_state = LocalStateType::create_unique(this, state);
505
355
    RETURN_IF_ERROR(local_state->init(state, info));
506
355
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
355
    return Status::OK();
508
355
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
45.9k
                                                            LocalSinkStateInfo& info) {
504
45.9k
    auto local_state = LocalStateType::create_unique(this, state);
505
45.9k
    RETURN_IF_ERROR(local_state->init(state, info));
506
45.9k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
45.9k
    return Status::OK();
508
45.9k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
16
                                                            LocalSinkStateInfo& info) {
504
16
    auto local_state = LocalStateType::create_unique(this, state);
505
16
    RETURN_IF_ERROR(local_state->init(state, info));
506
16
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
16
    return Status::OK();
508
16
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7.79k
                                                            LocalSinkStateInfo& info) {
504
7.79k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.79k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.79k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.79k
    return Status::OK();
508
7.79k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
15
                                                            LocalSinkStateInfo& info) {
504
15
    auto local_state = LocalStateType::create_unique(this, state);
505
15
    RETURN_IF_ERROR(local_state->init(state, info));
506
15
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
15
    return Status::OK();
508
15
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
196k
                                                            LocalSinkStateInfo& info) {
504
196k
    auto local_state = LocalStateType::create_unique(this, state);
505
196k
    RETURN_IF_ERROR(local_state->init(state, info));
506
196k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
196k
    return Status::OK();
508
196k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
29
                                                            LocalSinkStateInfo& info) {
504
29
    auto local_state = LocalStateType::create_unique(this, state);
505
29
    RETURN_IF_ERROR(local_state->init(state, info));
506
29
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
29
    return Status::OK();
508
29
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
238k
                                                            LocalSinkStateInfo& info) {
504
238k
    auto local_state = LocalStateType::create_unique(this, state);
505
238k
    RETURN_IF_ERROR(local_state->init(state, info));
506
238k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
238k
    return Status::OK();
508
238k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
90.1k
                                                            LocalSinkStateInfo& info) {
504
90.1k
    auto local_state = LocalStateType::create_unique(this, state);
505
90.1k
    RETURN_IF_ERROR(local_state->init(state, info));
506
90.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
90.1k
    return Status::OK();
508
90.1k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
104k
                                                            LocalSinkStateInfo& info) {
504
104k
    auto local_state = LocalStateType::create_unique(this, state);
505
104k
    RETURN_IF_ERROR(local_state->init(state, info));
506
104k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
104k
    return Status::OK();
508
104k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
116
                                                            LocalSinkStateInfo& info) {
504
116
    auto local_state = LocalStateType::create_unique(this, state);
505
116
    RETURN_IF_ERROR(local_state->init(state, info));
506
116
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
116
    return Status::OK();
508
116
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
475k
                                                            LocalSinkStateInfo& info) {
504
475k
    auto local_state = LocalStateType::create_unique(this, state);
505
475k
    RETURN_IF_ERROR(local_state->init(state, info));
506
475k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
475k
    return Status::OK();
508
475k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.01k
                                                            LocalSinkStateInfo& info) {
504
6.01k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.01k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.01k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.01k
    return Status::OK();
508
6.01k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
11.4k
                                                            LocalSinkStateInfo& info) {
504
11.4k
    auto local_state = LocalStateType::create_unique(this, state);
505
11.4k
    RETURN_IF_ERROR(local_state->init(state, info));
506
11.4k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
11.4k
    return Status::OK();
508
11.4k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.48k
                                                            LocalSinkStateInfo& info) {
504
2.48k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.48k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.48k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.48k
    return Status::OK();
508
2.48k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
325
                                                            LocalSinkStateInfo& info) {
504
325
    auto local_state = LocalStateType::create_unique(this, state);
505
325
    RETURN_IF_ERROR(local_state->init(state, info));
506
325
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
325
    return Status::OK();
508
325
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.86k
                                                            LocalSinkStateInfo& info) {
504
4.86k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.86k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.86k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.86k
    return Status::OK();
508
4.86k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.57k
                                                            LocalSinkStateInfo& info) {
504
2.57k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.57k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.57k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.57k
    return Status::OK();
508
2.57k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.63k
                                                            LocalSinkStateInfo& info) {
504
2.63k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.63k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.63k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.63k
    return Status::OK();
508
2.63k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.49k
                                                            LocalSinkStateInfo& info) {
504
2.49k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.49k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.49k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.49k
    return Status::OK();
508
2.49k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
570
                                                            LocalSinkStateInfo& info) {
504
570
    auto local_state = LocalStateType::create_unique(this, state);
505
570
    RETURN_IF_ERROR(local_state->init(state, info));
506
570
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
570
    return Status::OK();
508
570
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
106
                                                            LocalSinkStateInfo& info) {
504
106
    auto local_state = LocalStateType::create_unique(this, state);
505
106
    RETURN_IF_ERROR(local_state->init(state, info));
506
106
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
106
    return Status::OK();
508
106
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
509
510
template <typename LocalStateType>
511
1.33M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
0
                                 LocalExchangeSharedState>) {
514
0
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
0
                                        MultiCastSharedState>) {
517
0
        throw Exception(Status::FatalError("should not reach here!"));
518
1.33M
    } else {
519
1.33M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.33M
        ss->id = operator_id();
521
1.33M
        for (auto& dest : dests_id()) {
522
1.32M
            ss->related_op_ids.insert(dest);
523
1.32M
        }
524
1.33M
        return ss;
525
1.33M
    }
526
1.33M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
103k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
103k
    } else {
519
103k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
103k
        ss->id = operator_id();
521
103k
        for (auto& dest : dests_id()) {
522
102k
            ss->related_op_ids.insert(dest);
523
102k
        }
524
103k
        return ss;
525
103k
    }
526
103k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
397k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
397k
    } else {
519
397k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
397k
        ss->id = operator_id();
521
397k
        for (auto& dest : dests_id()) {
522
392k
            ss->related_op_ids.insert(dest);
523
392k
        }
524
397k
        return ss;
525
397k
    }
526
397k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
3
    } else {
519
3
        auto ss = LocalStateType::SharedStateType::create_shared();
520
3
        ss->id = operator_id();
521
3
        for (auto& dest : dests_id()) {
522
3
            ss->related_op_ids.insert(dest);
523
3
        }
524
3
        return ss;
525
3
    }
526
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
356
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
356
    } else {
519
356
        auto ss = LocalStateType::SharedStateType::create_shared();
520
356
        ss->id = operator_id();
521
356
        for (auto& dest : dests_id()) {
522
356
            ss->related_op_ids.insert(dest);
523
356
        }
524
356
        return ss;
525
356
    }
526
356
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46.0k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
46.0k
    } else {
519
46.0k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46.0k
        ss->id = operator_id();
521
46.0k
        for (auto& dest : dests_id()) {
522
45.8k
            ss->related_op_ids.insert(dest);
523
45.8k
        }
524
46.0k
        return ss;
525
46.0k
    }
526
46.0k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
16
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
16
    } else {
519
16
        auto ss = LocalStateType::SharedStateType::create_shared();
520
16
        ss->id = operator_id();
521
16
        for (auto& dest : dests_id()) {
522
16
            ss->related_op_ids.insert(dest);
523
16
        }
524
16
        return ss;
525
16
    }
526
16
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
7.81k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
7.81k
    } else {
519
7.81k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7.81k
        ss->id = operator_id();
521
7.81k
        for (auto& dest : dests_id()) {
522
7.80k
            ss->related_op_ids.insert(dest);
523
7.80k
        }
524
7.81k
        return ss;
525
7.81k
    }
526
7.81k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
15
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
15
    } else {
519
15
        auto ss = LocalStateType::SharedStateType::create_shared();
520
15
        ss->id = operator_id();
521
15
        for (auto& dest : dests_id()) {
522
15
            ss->related_op_ids.insert(dest);
523
15
        }
524
15
        return ss;
525
15
    }
526
15
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
197k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
197k
    } else {
519
197k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
197k
        ss->id = operator_id();
521
197k
        for (auto& dest : dests_id()) {
522
196k
            ss->related_op_ids.insert(dest);
523
196k
        }
524
197k
        return ss;
525
197k
    }
526
197k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
31
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
31
    } else {
519
31
        auto ss = LocalStateType::SharedStateType::create_shared();
520
31
        ss->id = operator_id();
521
31
        for (auto& dest : dests_id()) {
522
31
            ss->related_op_ids.insert(dest);
523
31
        }
524
31
        return ss;
525
31
    }
526
31
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
90.3k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
90.3k
    } else {
519
90.3k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
90.3k
        ss->id = operator_id();
521
90.3k
        for (auto& dest : dests_id()) {
522
90.0k
            ss->related_op_ids.insert(dest);
523
90.0k
        }
524
90.3k
        return ss;
525
90.3k
    }
526
90.3k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
115
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
115
    } else {
519
115
        auto ss = LocalStateType::SharedStateType::create_shared();
520
115
        ss->id = operator_id();
521
115
        for (auto& dest : dests_id()) {
522
115
            ss->related_op_ids.insert(dest);
523
115
        }
524
115
        return ss;
525
115
    }
526
115
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
475k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
475k
    } else {
519
475k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
475k
        ss->id = operator_id();
521
475k
        for (auto& dest : dests_id()) {
522
472k
            ss->related_op_ids.insert(dest);
523
472k
        }
524
475k
        return ss;
525
475k
    }
526
475k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.02k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6.02k
    } else {
519
6.02k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.02k
        ss->id = operator_id();
521
6.02k
        for (auto& dest : dests_id()) {
522
6.00k
            ss->related_op_ids.insert(dest);
523
6.00k
        }
524
6.02k
        return ss;
525
6.02k
    }
526
6.02k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
427
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
427
    } else {
519
427
        auto ss = LocalStateType::SharedStateType::create_shared();
520
427
        ss->id = operator_id();
521
427
        for (auto& dest : dests_id()) {
522
427
            ss->related_op_ids.insert(dest);
523
427
        }
524
427
        return ss;
525
427
    }
526
427
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.63k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.63k
    } else {
519
2.63k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.63k
        ss->id = operator_id();
521
2.63k
        for (auto& dest : dests_id()) {
522
2.60k
            ss->related_op_ids.insert(dest);
523
2.60k
        }
524
2.63k
        return ss;
525
2.63k
    }
526
2.63k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.49k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.49k
    } else {
519
2.49k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.49k
        ss->id = operator_id();
521
2.49k
        for (auto& dest : dests_id()) {
522
2.46k
            ss->related_op_ids.insert(dest);
523
2.46k
        }
524
2.49k
        return ss;
525
2.49k
    }
526
2.49k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
570
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
570
    } else {
519
570
        auto ss = LocalStateType::SharedStateType::create_shared();
520
570
        ss->id = operator_id();
521
570
        for (auto& dest : dests_id()) {
522
567
            ss->related_op_ids.insert(dest);
523
567
        }
524
570
        return ss;
525
570
    }
526
570
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
106
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
106
    } else {
519
106
        auto ss = LocalStateType::SharedStateType::create_shared();
520
106
        ss->id = operator_id();
521
106
        for (auto& dest : dests_id()) {
522
105
            ss->related_op_ids.insert(dest);
523
105
        }
524
106
        return ss;
525
106
    }
526
106
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.99M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.99M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.99M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.99M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.99M
    return Status::OK();
534
1.99M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
66.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
66.7k
    auto local_state = LocalStateType::create_unique(state, this);
531
66.7k
    RETURN_IF_ERROR(local_state->init(state, info));
532
66.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
66.7k
    return Status::OK();
534
66.7k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
238k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
238k
    auto local_state = LocalStateType::create_unique(state, this);
531
238k
    RETURN_IF_ERROR(local_state->init(state, info));
532
238k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
238k
    return Status::OK();
534
238k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
160
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
160
    auto local_state = LocalStateType::create_unique(state, this);
531
160
    RETURN_IF_ERROR(local_state->init(state, info));
532
160
    state->emplace_local_state(operator_id(), std::move(local_state));
533
160
    return Status::OK();
534
160
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.79k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.79k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.79k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.79k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.79k
    return Status::OK();
534
7.79k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.61k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.61k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.61k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.61k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.61k
    return Status::OK();
534
7.61k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
22
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
22
    auto local_state = LocalStateType::create_unique(state, this);
531
22
    RETURN_IF_ERROR(local_state->init(state, info));
532
22
    state->emplace_local_state(operator_id(), std::move(local_state));
533
22
    return Status::OK();
534
22
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
187k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
187k
    auto local_state = LocalStateType::create_unique(state, this);
531
187k
    RETURN_IF_ERROR(local_state->init(state, info));
532
187k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
187k
    return Status::OK();
534
187k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
89.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
89.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
89.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
89.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
89.8k
    return Status::OK();
534
89.8k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
104k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
104k
    auto local_state = LocalStateType::create_unique(state, this);
531
104k
    RETURN_IF_ERROR(local_state->init(state, info));
532
104k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
104k
    return Status::OK();
534
104k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
106
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
106
    auto local_state = LocalStateType::create_unique(state, this);
531
106
    RETURN_IF_ERROR(local_state->init(state, info));
532
106
    state->emplace_local_state(operator_id(), std::move(local_state));
533
106
    return Status::OK();
534
106
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.64k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.64k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.64k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.64k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.64k
    return Status::OK();
534
4.64k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
276k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
276k
    auto local_state = LocalStateType::create_unique(state, this);
531
276k
    RETURN_IF_ERROR(local_state->init(state, info));
532
276k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
276k
    return Status::OK();
534
276k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.26k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.26k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.26k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.26k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.26k
    return Status::OK();
534
1.26k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.00k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.00k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.00k
    return Status::OK();
534
6.00k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
27
    auto local_state = LocalStateType::create_unique(state, this);
531
27
    RETURN_IF_ERROR(local_state->init(state, info));
532
27
    state->emplace_local_state(operator_id(), std::move(local_state));
533
27
    return Status::OK();
534
27
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
54.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.4k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.4k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.4k
    return Status::OK();
534
54.4k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.63k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.63k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.63k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.63k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.63k
    return Status::OK();
534
5.63k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
322
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
322
    auto local_state = LocalStateType::create_unique(state, this);
531
322
    RETURN_IF_ERROR(local_state->init(state, info));
532
322
    state->emplace_local_state(operator_id(), std::move(local_state));
533
322
    return Status::OK();
534
322
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.63k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.63k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.63k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.63k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.63k
    return Status::OK();
534
2.63k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.49k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.49k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.49k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.49k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.49k
    return Status::OK();
534
2.49k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
316
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
316
    auto local_state = LocalStateType::create_unique(state, this);
531
316
    RETURN_IF_ERROR(local_state->init(state, info));
532
316
    state->emplace_local_state(operator_id(), std::move(local_state));
533
316
    return Status::OK();
534
316
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.3k
    return Status::OK();
534
10.3k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
634k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
634k
    auto local_state = LocalStateType::create_unique(state, this);
531
634k
    RETURN_IF_ERROR(local_state->init(state, info));
532
634k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
634k
    return Status::OK();
534
634k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
14
    auto local_state = LocalStateType::create_unique(state, this);
531
14
    RETURN_IF_ERROR(local_state->init(state, info));
532
14
    state->emplace_local_state(operator_id(), std::move(local_state));
533
14
    return Status::OK();
534
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
169
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
169
    auto local_state = LocalStateType::create_unique(state, this);
531
169
    RETURN_IF_ERROR(local_state->init(state, info));
532
169
    state->emplace_local_state(operator_id(), std::move(local_state));
533
169
    return Status::OK();
534
169
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.20k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.20k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.20k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.20k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.20k
    return Status::OK();
534
2.20k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
786
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
786
    auto local_state = LocalStateType::create_unique(state, this);
531
786
    RETURN_IF_ERROR(local_state->init(state, info));
532
786
    state->emplace_local_state(operator_id(), std::move(local_state));
533
786
    return Status::OK();
534
786
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
971
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
971
    auto local_state = LocalStateType::create_unique(state, this);
531
971
    RETURN_IF_ERROR(local_state->init(state, info));
532
971
    state->emplace_local_state(operator_id(), std::move(local_state));
533
971
    return Status::OK();
534
971
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.26k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.26k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.26k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.26k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.26k
    return Status::OK();
534
5.26k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
282k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
282k
    auto local_state = LocalStateType::create_unique(state, this);
531
282k
    RETURN_IF_ERROR(local_state->init(state, info));
532
282k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
282k
    return Status::OK();
534
282k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.69M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.99M
        : _num_rows_returned(0),
542
1.99M
          _rows_returned_counter(nullptr),
543
1.99M
          _parent(parent),
544
1.99M
          _state(state),
545
1.99M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.99M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.99M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.99M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.99M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.99M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1.99M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.99M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.99M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.99M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.99M
    if constexpr (!is_fake_shared) {
560
1.17M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
753k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
753k
                                    .first.get()
563
753k
                                    ->template cast<SharedStateArg>();
564
565
753k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
753k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
753k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
753k
        } else if (info.shared_state) {
569
369k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
369k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
369k
            _dependency = _shared_state->create_source_dependency(
576
369k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
369k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
369k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
369k
        } else {
580
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
18.4E
                DCHECK(false);
582
18.4E
            }
583
51.3k
        }
584
1.17M
    }
585
586
1.99M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1.99M
    _rows_returned_counter =
591
1.99M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.99M
    _blocks_returned_counter =
593
1.99M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.99M
    _output_block_bytes_counter =
595
1.99M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.99M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.99M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.99M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.99M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.99M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.99M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.99M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.99M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.99M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.99M
    _memory_used_counter =
606
1.99M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.99M
    _common_profile->add_info_string("IsColocate",
608
1.99M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.99M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.99M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.99M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.99M
    return Status::OK();
613
1.99M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
66.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
66.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
66.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
66.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
66.8k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
66.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
66.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
66.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
66.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
66.8k
    if constexpr (!is_fake_shared) {
560
66.8k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
11.8k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
11.8k
                                    .first.get()
563
11.8k
                                    ->template cast<SharedStateArg>();
564
565
11.8k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
11.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
11.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
55.0k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
55.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
55.0k
            _dependency = _shared_state->create_source_dependency(
576
55.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
55.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
55.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
55.0k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
61
        }
584
66.8k
    }
585
586
66.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
66.8k
    _rows_returned_counter =
591
66.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
66.8k
    _blocks_returned_counter =
593
66.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
66.8k
    _output_block_bytes_counter =
595
66.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
66.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
66.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
66.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
66.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
66.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
66.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
66.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
66.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
66.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
66.8k
    _memory_used_counter =
606
66.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
66.8k
    _common_profile->add_info_string("IsColocate",
608
66.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
66.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
66.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
66.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
66.8k
    return Status::OK();
613
66.8k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1
    _operator_profile->add_child(_common_profile.get(), true);
557
1
    _operator_profile->add_child(_custom_profile.get(), true);
558
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1
    if constexpr (!is_fake_shared) {
560
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
1
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1
            _dependency = _shared_state->create_source_dependency(
576
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
1
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
1
    }
585
586
1
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1
    _rows_returned_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1
    _blocks_returned_counter =
593
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1
    _output_block_bytes_counter =
595
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1
    _memory_used_counter =
606
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1
    _common_profile->add_info_string("IsColocate",
608
1
                                     std::to_string(_parent->is_colocated_operator()));
609
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1
    return Status::OK();
613
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
196k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
196k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
196k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
196k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
196k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
196k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
196k
    _operator_profile->add_child(_common_profile.get(), true);
557
196k
    _operator_profile->add_child(_custom_profile.get(), true);
558
196k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
196k
    if constexpr (!is_fake_shared) {
560
196k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
196k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
195k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
195k
            _dependency = _shared_state->create_source_dependency(
576
195k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
195k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
195k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
195k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
926
        }
584
196k
    }
585
586
196k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
196k
    _rows_returned_counter =
591
196k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
196k
    _blocks_returned_counter =
593
196k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
196k
    _output_block_bytes_counter =
595
196k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
196k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
196k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
196k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
196k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
196k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
196k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
196k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
196k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
196k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
196k
    _memory_used_counter =
606
196k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
196k
    _common_profile->add_info_string("IsColocate",
608
196k
                                     std::to_string(_parent->is_colocated_operator()));
609
196k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
196k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
196k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
196k
    return Status::OK();
613
196k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
22
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
22
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
22
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
22
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
22
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
22
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
22
    _operator_profile->add_child(_common_profile.get(), true);
557
22
    _operator_profile->add_child(_custom_profile.get(), true);
558
22
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
22
    if constexpr (!is_fake_shared) {
560
22
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
22
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
22
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
22
            _dependency = _shared_state->create_source_dependency(
576
22
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
22
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
22
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
22
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
22
    }
585
586
22
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
22
    _rows_returned_counter =
591
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
22
    _blocks_returned_counter =
593
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
22
    _output_block_bytes_counter =
595
22
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
22
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
22
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
22
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
22
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
22
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
22
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
22
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
22
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
22
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
22
    _memory_used_counter =
606
22
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
22
    _common_profile->add_info_string("IsColocate",
608
22
                                     std::to_string(_parent->is_colocated_operator()));
609
22
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
22
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
22
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
22
    return Status::OK();
613
22
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.02k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.02k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.02k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.02k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.02k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.02k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.02k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.02k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.02k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.02k
    if constexpr (!is_fake_shared) {
560
6.02k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.02k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.01k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.01k
            _dependency = _shared_state->create_source_dependency(
576
6.01k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.01k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.01k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.01k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
6
        }
584
6.02k
    }
585
586
6.02k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.02k
    _rows_returned_counter =
591
6.02k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.02k
    _blocks_returned_counter =
593
6.02k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.02k
    _output_block_bytes_counter =
595
6.02k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.02k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.02k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.02k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.02k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.02k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.02k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.02k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.02k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.02k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.02k
    _memory_used_counter =
606
6.02k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.02k
    _common_profile->add_info_string("IsColocate",
608
6.02k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.02k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.02k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.02k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.02k
    return Status::OK();
613
6.02k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
7.81k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
7.81k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
7.81k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
7.81k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
7.81k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
7.81k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
7.81k
    _operator_profile->add_child(_common_profile.get(), true);
557
7.81k
    _operator_profile->add_child(_custom_profile.get(), true);
558
7.81k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
7.81k
    if constexpr (!is_fake_shared) {
560
7.81k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
7.81k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
7.81k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
7.81k
            _dependency = _shared_state->create_source_dependency(
576
7.81k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
7.81k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
7.81k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
7.81k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
4
        }
584
7.81k
    }
585
586
7.81k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
7.81k
    _rows_returned_counter =
591
7.81k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
7.81k
    _blocks_returned_counter =
593
7.81k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
7.81k
    _output_block_bytes_counter =
595
7.81k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.81k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
7.81k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
7.81k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
7.81k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
7.81k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
7.81k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
7.81k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
7.81k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
7.81k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
7.81k
    _memory_used_counter =
606
7.81k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
7.81k
    _common_profile->add_info_string("IsColocate",
608
7.81k
                                     std::to_string(_parent->is_colocated_operator()));
609
7.81k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
7.81k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
7.81k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
7.81k
    return Status::OK();
613
7.81k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
90.1k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
90.1k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
90.1k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
90.1k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
90.1k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
90.1k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
90.1k
    _operator_profile->add_child(_common_profile.get(), true);
557
90.1k
    _operator_profile->add_child(_custom_profile.get(), true);
558
90.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
90.1k
    if constexpr (!is_fake_shared) {
560
90.1k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
90.1k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
89.5k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
89.5k
            _dependency = _shared_state->create_source_dependency(
576
89.5k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
89.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
89.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
89.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
621
        }
584
90.1k
    }
585
586
90.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
90.1k
    _rows_returned_counter =
591
90.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
90.1k
    _blocks_returned_counter =
593
90.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
90.1k
    _output_block_bytes_counter =
595
90.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
90.1k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
90.1k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
90.1k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
90.1k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
90.1k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
90.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
90.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
90.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
90.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
90.1k
    _memory_used_counter =
606
90.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
90.1k
    _common_profile->add_info_string("IsColocate",
608
90.1k
                                     std::to_string(_parent->is_colocated_operator()));
609
90.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
90.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
90.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
90.1k
    return Status::OK();
613
90.1k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
104k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
104k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
104k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
104k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
104k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
104k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
104k
    _operator_profile->add_child(_common_profile.get(), true);
557
104k
    _operator_profile->add_child(_custom_profile.get(), true);
558
104k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
104k
    if constexpr (!is_fake_shared) {
560
104k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
104k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
104k
                                    .first.get()
563
104k
                                    ->template cast<SharedStateArg>();
564
565
104k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
104k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
104k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
104k
    }
585
586
104k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
104k
    _rows_returned_counter =
591
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
104k
    _blocks_returned_counter =
593
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
104k
    _output_block_bytes_counter =
595
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
104k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
104k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
104k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
104k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
104k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
104k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
104k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
104k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
104k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
104k
    _memory_used_counter =
606
104k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
104k
    _common_profile->add_info_string("IsColocate",
608
104k
                                     std::to_string(_parent->is_colocated_operator()));
609
104k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
104k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
104k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
104k
    return Status::OK();
613
104k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
106
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
106
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
106
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
106
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
106
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
106
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
106
    _operator_profile->add_child(_common_profile.get(), true);
557
106
    _operator_profile->add_child(_custom_profile.get(), true);
558
106
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
106
    if constexpr (!is_fake_shared) {
560
106
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
106
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
106
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
106
            _dependency = _shared_state->create_source_dependency(
576
106
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
106
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
106
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
106
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
106
    }
585
586
106
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
106
    _rows_returned_counter =
591
106
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
106
    _blocks_returned_counter =
593
106
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
106
    _output_block_bytes_counter =
595
106
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
106
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
106
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
106
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
106
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
106
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
106
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
106
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
106
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
106
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
106
    _memory_used_counter =
606
106
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
106
    _common_profile->add_info_string("IsColocate",
608
106
                                     std::to_string(_parent->is_colocated_operator()));
609
106
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
106
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
106
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
106
    return Status::OK();
613
106
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
825k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
825k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
825k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
825k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
825k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
825k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
825k
    _operator_profile->add_child(_common_profile.get(), true);
557
825k
    _operator_profile->add_child(_custom_profile.get(), true);
558
825k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
    if constexpr (!is_fake_shared) {
560
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
                                    .first.get()
563
                                    ->template cast<SharedStateArg>();
564
565
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
            _dependency = _shared_state->create_source_dependency(
576
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
        }
584
    }
585
586
825k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
825k
    _rows_returned_counter =
591
825k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
825k
    _blocks_returned_counter =
593
825k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
825k
    _output_block_bytes_counter =
595
825k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
825k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
825k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
825k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
825k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
825k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
825k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
825k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
825k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
825k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
825k
    _memory_used_counter =
606
825k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
825k
    _common_profile->add_info_string("IsColocate",
608
825k
                                     std::to_string(_parent->is_colocated_operator()));
609
825k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
825k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
825k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
825k
    return Status::OK();
613
825k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.4k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
54.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.4k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.4k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.4k
    if constexpr (!is_fake_shared) {
560
54.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.4k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.60k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.60k
            _dependency = _shared_state->create_source_dependency(
576
4.60k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.60k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.60k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
49.8k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
49.8k
        }
584
54.4k
    }
585
586
54.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
54.4k
    _rows_returned_counter =
591
54.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.4k
    _blocks_returned_counter =
593
54.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.4k
    _output_block_bytes_counter =
595
54.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.4k
    _memory_used_counter =
606
54.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.4k
    _common_profile->add_info_string("IsColocate",
608
54.4k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.4k
    return Status::OK();
613
54.4k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.63k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.63k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.63k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.63k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.63k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.63k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.63k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.63k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.63k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.63k
    if constexpr (!is_fake_shared) {
560
5.63k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.63k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.63k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.63k
            _dependency = _shared_state->create_source_dependency(
576
5.63k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.63k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.63k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.63k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
9
        }
584
5.63k
    }
585
586
5.63k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.63k
    _rows_returned_counter =
591
5.63k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.63k
    _blocks_returned_counter =
593
5.63k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.63k
    _output_block_bytes_counter =
595
5.63k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.63k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.63k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.63k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.63k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.63k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.63k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.63k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.63k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.63k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.63k
    _memory_used_counter =
606
5.63k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.63k
    _common_profile->add_info_string("IsColocate",
608
5.63k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.63k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.63k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.63k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.63k
    return Status::OK();
613
5.63k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
426
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
426
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
426
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
426
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
426
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
426
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
426
    _operator_profile->add_child(_common_profile.get(), true);
557
426
    _operator_profile->add_child(_custom_profile.get(), true);
558
426
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
426
    if constexpr (!is_fake_shared) {
560
426
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
427
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
427
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
427
            _dependency = _shared_state->create_source_dependency(
576
427
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
427
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
427
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
426
    }
585
586
427
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
426
    _rows_returned_counter =
591
426
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
426
    _blocks_returned_counter =
593
426
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
426
    _output_block_bytes_counter =
595
426
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
426
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
426
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
426
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
426
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
426
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
426
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
426
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
426
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
426
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
426
    _memory_used_counter =
606
426
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
426
    _common_profile->add_info_string("IsColocate",
608
426
                                     std::to_string(_parent->is_colocated_operator()));
609
426
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
426
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
426
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
426
    return Status::OK();
613
426
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.16k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.16k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.16k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.16k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.16k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.16k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.16k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.16k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.16k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.16k
    if constexpr (!is_fake_shared) {
560
5.16k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.16k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.13k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.13k
            _dependency = _shared_state->create_source_dependency(
576
5.13k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.13k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.13k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.13k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
23
        }
584
5.16k
    }
585
586
5.16k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.16k
    _rows_returned_counter =
591
5.16k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.16k
    _blocks_returned_counter =
593
5.16k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.16k
    _output_block_bytes_counter =
595
5.16k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.16k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.16k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.16k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.16k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.16k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.16k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.16k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.16k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.16k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.16k
    _memory_used_counter =
606
5.16k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.16k
    _common_profile->add_info_string("IsColocate",
608
5.16k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.16k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.16k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.16k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.16k
    return Status::OK();
613
5.16k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
636k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
636k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
636k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
636k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
636k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
636k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
636k
    _operator_profile->add_child(_common_profile.get(), true);
557
636k
    _operator_profile->add_child(_custom_profile.get(), true);
558
636k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
636k
    if constexpr (!is_fake_shared) {
560
637k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
637k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
637k
                                    .first.get()
563
637k
                                    ->template cast<SharedStateArg>();
564
565
637k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
637k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
637k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } else if (info.shared_state) {
569
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
18.4E
                DCHECK(false);
582
18.4E
            }
583
18.4E
        }
584
636k
    }
585
586
636k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
636k
    _rows_returned_counter =
591
636k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
636k
    _blocks_returned_counter =
593
636k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
636k
    _output_block_bytes_counter =
595
636k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
636k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
636k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
636k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
636k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
636k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
636k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
636k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
636k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
636k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
636k
    _memory_used_counter =
606
636k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
636k
    _common_profile->add_info_string("IsColocate",
608
636k
                                     std::to_string(_parent->is_colocated_operator()));
609
636k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
636k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
636k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
636k
    return Status::OK();
613
636k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
169
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
169
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
169
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
169
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
169
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
169
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
169
    _operator_profile->add_child(_common_profile.get(), true);
557
169
    _operator_profile->add_child(_custom_profile.get(), true);
558
169
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
169
    if constexpr (!is_fake_shared) {
560
169
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
169
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
169
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
169
            _dependency = _shared_state->create_source_dependency(
576
169
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
169
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
169
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
169
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
169
    }
585
586
169
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
169
    _rows_returned_counter =
591
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
169
    _blocks_returned_counter =
593
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
169
    _output_block_bytes_counter =
595
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
169
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
169
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
169
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
169
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
169
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
169
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
169
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
169
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
169
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
169
    _memory_used_counter =
606
169
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
169
    _common_profile->add_info_string("IsColocate",
608
169
                                     std::to_string(_parent->is_colocated_operator()));
609
169
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
169
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
169
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
169
    return Status::OK();
613
169
}
614
615
template <typename SharedStateArg>
616
2.00M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.00M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.31M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
303k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
303k
    }
621
2.00M
    if (_parent->has_projection()) {
622
370k
        const auto& projection = *_parent->_projection;
623
370k
        _projections.resize(projection.projections.size());
624
2.32M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.95M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.95M
        }
627
370k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
382k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
12.9k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
223k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
210k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
210k
                        state, _intermediate_projections[i][j]));
633
210k
            }
634
12.9k
        }
635
370k
    }
636
2.00M
    return Status::OK();
637
2.00M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
66.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
66.9k
    _conjuncts.resize(_parent->_conjuncts.size());
618
68.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.44k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.44k
    }
621
66.9k
    if (_parent->has_projection()) {
622
66.9k
        const auto& projection = *_parent->_projection;
623
66.9k
        _projections.resize(projection.projections.size());
624
365k
        for (size_t i = 0; i < _projections.size(); i++) {
625
298k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
298k
        }
627
66.9k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
74.1k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.26k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
185k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
178k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
178k
                        state, _intermediate_projections[i][j]));
633
178k
            }
634
7.26k
        }
635
66.9k
    }
636
66.9k
    return Status::OK();
637
66.9k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
3
    _conjuncts.resize(_parent->_conjuncts.size());
618
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
3
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
3
    return Status::OK();
637
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
197k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
197k
    _conjuncts.resize(_parent->_conjuncts.size());
618
197k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
197k
    if (_parent->has_projection()) {
622
80
        const auto& projection = *_parent->_projection;
623
80
        _projections.resize(projection.projections.size());
624
405
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
80
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
80
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
80
    }
636
197k
    return Status::OK();
637
197k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
22
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
22
    _conjuncts.resize(_parent->_conjuncts.size());
618
22
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
22
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
22
    return Status::OK();
637
22
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.01k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.01k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.09k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
71
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
71
    }
621
6.02k
    if (_parent->has_projection()) {
622
6.02k
        const auto& projection = *_parent->_projection;
623
6.02k
        _projections.resize(projection.projections.size());
624
28.3k
        for (size_t i = 0; i < _projections.size(); i++) {
625
22.2k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
22.2k
        }
627
6.02k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.05k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
30
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
211
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
181
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
181
                        state, _intermediate_projections[i][j]));
633
181
            }
634
30
        }
635
6.02k
    }
636
6.01k
    return Status::OK();
637
6.01k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
7.82k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
7.82k
    _conjuncts.resize(_parent->_conjuncts.size());
618
8.59k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
772
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
772
    }
621
7.82k
    if (_parent->has_projection()) {
622
4.47k
        const auto& projection = *_parent->_projection;
623
4.47k
        _projections.resize(projection.projections.size());
624
18.2k
        for (size_t i = 0; i < _projections.size(); i++) {
625
13.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
13.8k
        }
627
4.47k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.56k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
89
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
676
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
587
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
587
                        state, _intermediate_projections[i][j]));
633
587
            }
634
89
        }
635
4.47k
    }
636
7.82k
    return Status::OK();
637
7.82k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
90.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
90.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
91.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.49k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.49k
    }
621
90.3k
    if (_parent->has_projection()) {
622
29.4k
        const auto& projection = *_parent->_projection;
623
29.4k
        _projections.resize(projection.projections.size());
624
272k
        for (size_t i = 0; i < _projections.size(); i++) {
625
243k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
243k
        }
627
29.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
29.6k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
170
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.04k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
870
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
870
                        state, _intermediate_projections[i][j]));
633
870
            }
634
170
        }
635
29.4k
    }
636
90.3k
    return Status::OK();
637
90.3k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
104k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
104k
    _conjuncts.resize(_parent->_conjuncts.size());
618
104k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
12
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
12
    }
621
104k
    if (_parent->has_projection()) {
622
178
        const auto& projection = *_parent->_projection;
623
178
        _projections.resize(projection.projections.size());
624
707
        for (size_t i = 0; i < _projections.size(); i++) {
625
529
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
529
        }
627
178
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
178
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
178
    }
636
104k
    return Status::OK();
637
104k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
110
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
110
    _conjuncts.resize(_parent->_conjuncts.size());
618
110
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
110
    if (_parent->has_projection()) {
622
96
        const auto& projection = *_parent->_projection;
623
96
        _projections.resize(projection.projections.size());
624
288
        for (size_t i = 0; i < _projections.size(); i++) {
625
192
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
192
        }
627
96
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
96
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
96
    }
636
110
    return Status::OK();
637
110
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
830k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
830k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.12M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
299k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
299k
    }
621
830k
    if (_parent->has_projection()) {
622
251k
        const auto& projection = *_parent->_projection;
623
251k
        _projections.resize(projection.projections.size());
624
1.53M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.28M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.28M
        }
627
251k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
256k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
5.20k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
32.9k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
27.7k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
27.7k
                        state, _intermediate_projections[i][j]));
633
27.7k
            }
634
5.20k
        }
635
251k
    }
636
830k
    return Status::OK();
637
830k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.7k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.7k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.7k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
54.7k
    if (_parent->has_projection()) {
622
11.3k
        const auto& projection = *_parent->_projection;
623
11.3k
        _projections.resize(projection.projections.size());
624
110k
        for (size_t i = 0; i < _projections.size(); i++) {
625
98.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
98.8k
        }
627
11.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
144
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3.01k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
2.86k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
2.86k
                        state, _intermediate_projections[i][j]));
633
2.86k
            }
634
144
        }
635
11.3k
    }
636
54.7k
    return Status::OK();
637
54.7k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.61k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.61k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.11k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
493
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
493
    }
621
5.61k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
5.61k
    return Status::OK();
637
5.61k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
427
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
427
    _conjuncts.resize(_parent->_conjuncts.size());
618
427
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
427
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
427
    return Status::OK();
637
427
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.16k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.16k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.16k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
5.16k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
227
        for (size_t i = 0; i < _projections.size(); i++) {
625
167
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
167
        }
627
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
60
    }
636
5.16k
    return Status::OK();
637
5.16k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
638k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
638k
    _conjuncts.resize(_parent->_conjuncts.size());
618
638k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
638k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
638k
    return Status::OK();
637
638k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
169
    _conjuncts.resize(_parent->_conjuncts.size());
618
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
169
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
491
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
166
    }
636
169
    return Status::OK();
637
169
}
638
639
template <typename SharedStateArg>
640
11.6k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
11.6k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
11.6k
    _terminated = true;
645
11.6k
    return Status::OK();
646
11.6k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
424
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
424
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
424
    _terminated = true;
645
424
    return Status::OK();
646
424
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
22
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
22
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
22
    _terminated = true;
645
22
    return Status::OK();
646
22
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
30
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
30
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
30
    _terminated = true;
645
30
    return Status::OK();
646
30
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
70
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
70
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
70
    _terminated = true;
645
70
    return Status::OK();
646
70
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
3
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
3
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
3
    _terminated = true;
645
3
    return Status::OK();
646
3
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
9.66k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
9.66k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
9.66k
    _terminated = true;
645
9.66k
    return Status::OK();
646
9.66k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
46
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
46
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
46
    _terminated = true;
645
46
    return Status::OK();
646
46
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
6
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6
    _terminated = true;
645
6
    return Status::OK();
646
6
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1
    _terminated = true;
645
1
    return Status::OK();
646
1
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.32k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.32k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1.32k
    _terminated = true;
645
1.32k
    return Status::OK();
646
1.32k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
38
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
38
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
38
    _terminated = true;
645
38
    return Status::OK();
646
38
}
647
648
template <typename SharedStateArg>
649
2.23M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.23M
    if (_closed) {
651
224k
        return Status::OK();
652
224k
    }
653
2.00M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.17M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.17M
    }
656
2.00M
    _closed = true;
657
2.00M
    return Status::OK();
658
2.23M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
66.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
66.9k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
66.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
66.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
66.9k
    }
656
66.9k
    _closed = true;
657
66.9k
    return Status::OK();
658
66.9k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4
    }
656
4
    _closed = true;
657
4
    return Status::OK();
658
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
392k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
392k
    if (_closed) {
651
195k
        return Status::OK();
652
195k
    }
653
196k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
196k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
196k
    }
656
196k
    _closed = true;
657
196k
    return Status::OK();
658
392k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
22
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
22
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
22
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
22
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
22
    }
656
22
    _closed = true;
657
22
    return Status::OK();
658
22
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.01k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.01k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.01k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.01k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.01k
    }
656
6.01k
    _closed = true;
657
6.01k
    return Status::OK();
658
6.01k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
15.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
15.7k
    if (_closed) {
651
7.91k
        return Status::OK();
652
7.91k
    }
653
7.81k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
7.81k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
7.81k
    }
656
7.81k
    _closed = true;
657
7.81k
    return Status::OK();
658
15.7k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
90.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
90.1k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
90.1k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
90.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
90.1k
    }
656
90.1k
    _closed = true;
657
90.1k
    return Status::OK();
658
90.1k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
104k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
104k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
104k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
104k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
104k
    }
656
104k
    _closed = true;
657
104k
    return Status::OK();
658
104k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
105
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
105
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
105
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
105
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
105
    }
656
105
    _closed = true;
657
105
    return Status::OK();
658
105
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
846k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
846k
    if (_closed) {
651
15.1k
        return Status::OK();
652
15.1k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
831k
    _closed = true;
657
831k
    return Status::OK();
658
846k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.7k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.7k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.7k
    }
656
54.7k
    _closed = true;
657
54.7k
    return Status::OK();
658
54.7k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
27
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
27
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
13
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
13
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
13
    }
656
13
    _closed = true;
657
13
    return Status::OK();
658
27
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.60k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.60k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.60k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.60k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.60k
    }
656
5.60k
    _closed = true;
657
5.60k
    return Status::OK();
658
5.60k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
650
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
650
    if (_closed) {
651
325
        return Status::OK();
652
325
    }
653
325
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
325
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
325
    }
656
325
    _closed = true;
657
325
    return Status::OK();
658
650
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.5k
    if (_closed) {
651
5.44k
        return Status::OK();
652
5.44k
    }
653
5.15k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.15k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.15k
    }
656
5.15k
    _closed = true;
657
5.15k
    return Status::OK();
658
10.5k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
639k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
639k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
639k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
639k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
639k
    }
656
639k
    _closed = true;
657
639k
    return Status::OK();
658
639k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
335
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
335
    if (_closed) {
651
175
        return Status::OK();
652
175
    }
653
160
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
160
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
160
    }
656
160
    _closed = true;
657
160
    return Status::OK();
658
335
}
659
660
template <typename SharedState>
661
1.69M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.69M
    _operator_profile =
664
1.69M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.69M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.69M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
1.69M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.69M
    _operator_profile->add_child(_common_profile, true);
673
1.69M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.69M
    _operator_profile->set_metadata(_parent->node_id());
676
1.69M
    _wait_for_finish_dependency_timer =
677
1.69M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.69M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.69M
    if constexpr (!is_fake_shared) {
680
1.22M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.22M
            info.shared_state_map.end()) {
682
355k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
239k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
239k
            }
685
355k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
355k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
355k
                                                  ? 0
688
355k
                                                  : info.task_idx]
689
355k
                                  .get();
690
355k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
868k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
868k
            _shared_state = info.shared_state->template cast<SharedState>();
696
868k
            _dependency = _shared_state->create_sink_dependency(
697
868k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
868k
        }
699
1.22M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.22M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.22M
    }
702
703
1.69M
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
1.69M
    _rows_input_counter =
708
1.69M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.69M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.69M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.69M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.69M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.69M
    _memory_used_counter =
714
1.69M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.69M
    _common_profile->add_info_string("IsColocate",
716
1.69M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.69M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.69M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.69M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.69M
    return Status::OK();
721
1.69M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
114k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
114k
    _operator_profile =
664
114k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
114k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
114k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
114k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
114k
    _operator_profile->add_child(_common_profile, true);
673
114k
    _operator_profile->add_child(_custom_profile, true);
674
675
114k
    _operator_profile->set_metadata(_parent->node_id());
676
114k
    _wait_for_finish_dependency_timer =
677
114k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
114k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
114k
    if constexpr (!is_fake_shared) {
680
114k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
114k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
11.8k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
11.8k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
11.8k
                                                  ? 0
688
11.8k
                                                  : info.task_idx]
689
11.8k
                                  .get();
690
11.8k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
102k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
102k
            _shared_state = info.shared_state->template cast<SharedState>();
696
102k
            _dependency = _shared_state->create_sink_dependency(
697
102k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
102k
        }
699
114k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
114k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
114k
    }
702
703
114k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
114k
    _rows_input_counter =
708
114k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
114k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
114k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
114k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
114k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
114k
    _memory_used_counter =
714
114k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
114k
    _common_profile->add_info_string("IsColocate",
716
114k
                                     std::to_string(_parent->is_colocated_operator()));
717
114k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
114k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
114k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
114k
    return Status::OK();
721
114k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2
    _operator_profile =
664
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2
    _operator_profile->add_child(_common_profile, true);
673
2
    _operator_profile->add_child(_custom_profile, true);
674
675
2
    _operator_profile->set_metadata(_parent->node_id());
676
2
    _wait_for_finish_dependency_timer =
677
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2
    if constexpr (!is_fake_shared) {
680
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2
            _shared_state = info.shared_state->template cast<SharedState>();
696
2
            _dependency = _shared_state->create_sink_dependency(
697
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2
        }
699
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2
    }
702
703
2
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2
    _rows_input_counter =
708
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2
    _memory_used_counter =
714
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2
    _common_profile->add_info_string("IsColocate",
716
2
                                     std::to_string(_parent->is_colocated_operator()));
717
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2
    return Status::OK();
721
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
195k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
195k
    _operator_profile =
664
195k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
195k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
195k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
195k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
195k
    _operator_profile->add_child(_common_profile, true);
673
195k
    _operator_profile->add_child(_custom_profile, true);
674
675
195k
    _operator_profile->set_metadata(_parent->node_id());
676
195k
    _wait_for_finish_dependency_timer =
677
195k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
195k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
195k
    if constexpr (!is_fake_shared) {
680
195k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
195k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
195k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
195k
            _shared_state = info.shared_state->template cast<SharedState>();
696
195k
            _dependency = _shared_state->create_sink_dependency(
697
195k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
195k
        }
699
195k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
195k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
195k
    }
702
703
195k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
195k
    _rows_input_counter =
708
195k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
195k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
195k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
195k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
195k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
195k
    _memory_used_counter =
714
195k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
195k
    _common_profile->add_info_string("IsColocate",
716
195k
                                     std::to_string(_parent->is_colocated_operator()));
717
195k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
195k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
195k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
195k
    return Status::OK();
721
195k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
29
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
29
    _operator_profile =
664
29
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
29
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
29
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
29
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
29
    _operator_profile->add_child(_common_profile, true);
673
29
    _operator_profile->add_child(_custom_profile, true);
674
675
29
    _operator_profile->set_metadata(_parent->node_id());
676
29
    _wait_for_finish_dependency_timer =
677
29
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
29
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
29
    if constexpr (!is_fake_shared) {
680
29
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
29
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
29
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
29
            _shared_state = info.shared_state->template cast<SharedState>();
696
29
            _dependency = _shared_state->create_sink_dependency(
697
29
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
29
        }
699
29
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
29
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
29
    }
702
703
29
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
29
    _rows_input_counter =
708
29
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
29
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
29
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
29
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
29
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
29
    _memory_used_counter =
714
29
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
29
    _common_profile->add_info_string("IsColocate",
716
29
                                     std::to_string(_parent->is_colocated_operator()));
717
29
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
29
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
29
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
29
    return Status::OK();
721
29
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.00k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.00k
    _operator_profile =
664
6.00k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.00k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.00k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
6.00k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.00k
    _operator_profile->add_child(_common_profile, true);
673
6.00k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.00k
    _operator_profile->set_metadata(_parent->node_id());
676
6.00k
    _wait_for_finish_dependency_timer =
677
6.00k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.00k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.00k
    if constexpr (!is_fake_shared) {
680
6.00k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.00k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
6.00k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.00k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.00k
            _dependency = _shared_state->create_sink_dependency(
697
6.00k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.00k
        }
699
6.00k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.00k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.00k
    }
702
703
6.00k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
6.00k
    _rows_input_counter =
708
6.00k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.00k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.00k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.00k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.00k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.00k
    _memory_used_counter =
714
6.00k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.00k
    _common_profile->add_info_string("IsColocate",
716
6.00k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.00k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.00k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.00k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.00k
    return Status::OK();
721
6.00k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.77k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.77k
    _operator_profile =
664
7.77k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.77k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.77k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
7.77k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.77k
    _operator_profile->add_child(_common_profile, true);
673
7.77k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.77k
    _operator_profile->set_metadata(_parent->node_id());
676
7.77k
    _wait_for_finish_dependency_timer =
677
7.77k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.77k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.77k
    if constexpr (!is_fake_shared) {
680
7.77k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.77k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
7.77k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.77k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.77k
            _dependency = _shared_state->create_sink_dependency(
697
7.77k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.77k
        }
699
7.77k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.77k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.77k
    }
702
703
7.77k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
7.77k
    _rows_input_counter =
708
7.77k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.77k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.77k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.77k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.77k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.77k
    _memory_used_counter =
714
7.77k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.77k
    _common_profile->add_info_string("IsColocate",
716
7.77k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.77k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.77k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.77k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.77k
    return Status::OK();
721
7.77k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
90.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
90.1k
    _operator_profile =
664
90.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
90.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
90.1k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
90.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
90.1k
    _operator_profile->add_child(_common_profile, true);
673
90.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
90.1k
    _operator_profile->set_metadata(_parent->node_id());
676
90.1k
    _wait_for_finish_dependency_timer =
677
90.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
90.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
90.1k
    if constexpr (!is_fake_shared) {
680
90.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
90.1k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
90.1k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
90.1k
            _shared_state = info.shared_state->template cast<SharedState>();
696
90.1k
            _dependency = _shared_state->create_sink_dependency(
697
90.1k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
90.1k
        }
699
90.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
90.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
90.1k
    }
702
703
90.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
90.1k
    _rows_input_counter =
708
90.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
90.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
90.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
90.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
90.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
90.1k
    _memory_used_counter =
714
90.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
90.1k
    _common_profile->add_info_string("IsColocate",
716
90.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
90.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
90.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
90.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
90.1k
    return Status::OK();
721
90.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
104k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
104k
    _operator_profile =
664
104k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
104k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
104k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
104k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
104k
    _operator_profile->add_child(_common_profile, true);
673
104k
    _operator_profile->add_child(_custom_profile, true);
674
675
104k
    _operator_profile->set_metadata(_parent->node_id());
676
104k
    _wait_for_finish_dependency_timer =
677
104k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
104k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
104k
    if constexpr (!is_fake_shared) {
680
104k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
104k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
104k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
104k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
104k
                                                  ? 0
688
104k
                                                  : info.task_idx]
689
104k
                                  .get();
690
104k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
104k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
104k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
104k
    }
702
703
104k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
104k
    _rows_input_counter =
708
104k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
104k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
104k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
104k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
104k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
104k
    _memory_used_counter =
714
104k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
104k
    _common_profile->add_info_string("IsColocate",
716
104k
                                     std::to_string(_parent->is_colocated_operator()));
717
104k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
104k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
104k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
104k
    return Status::OK();
721
104k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
116
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
116
    _operator_profile =
664
116
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
116
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
116
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
116
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
116
    _operator_profile->add_child(_common_profile, true);
673
116
    _operator_profile->add_child(_custom_profile, true);
674
675
116
    _operator_profile->set_metadata(_parent->node_id());
676
116
    _wait_for_finish_dependency_timer =
677
116
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
116
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
116
    if constexpr (!is_fake_shared) {
680
116
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
116
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
116
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
116
            _shared_state = info.shared_state->template cast<SharedState>();
696
116
            _dependency = _shared_state->create_sink_dependency(
697
116
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
116
        }
699
116
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
116
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
116
    }
702
703
116
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
116
    _rows_input_counter =
708
116
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
116
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
116
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
116
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
116
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
116
    _memory_used_counter =
714
116
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
116
    _common_profile->add_info_string("IsColocate",
716
116
                                     std::to_string(_parent->is_colocated_operator()));
717
116
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
116
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
116
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
116
    return Status::OK();
721
116
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
473k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
473k
    _operator_profile =
664
473k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
473k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
473k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
473k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
473k
    _operator_profile->add_child(_common_profile, true);
673
473k
    _operator_profile->add_child(_custom_profile, true);
674
675
473k
    _operator_profile->set_metadata(_parent->node_id());
676
473k
    _wait_for_finish_dependency_timer =
677
473k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
473k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
    if constexpr (!is_fake_shared) {
680
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
                                                  ? 0
688
                                                  : info.task_idx]
689
                                  .get();
690
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
            _shared_state = info.shared_state->template cast<SharedState>();
696
            _dependency = _shared_state->create_sink_dependency(
697
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
        }
699
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
    }
702
703
473k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
473k
    _rows_input_counter =
708
473k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
473k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
473k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
473k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
473k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
473k
    _memory_used_counter =
714
473k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
473k
    _common_profile->add_info_string("IsColocate",
716
473k
                                     std::to_string(_parent->is_colocated_operator()));
717
473k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
473k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
473k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
473k
    return Status::OK();
721
473k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
11.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
11.4k
    _operator_profile =
664
11.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
11.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
11.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
11.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
11.4k
    _operator_profile->add_child(_common_profile, true);
673
11.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
11.4k
    _operator_profile->set_metadata(_parent->node_id());
676
11.4k
    _wait_for_finish_dependency_timer =
677
11.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
11.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
11.4k
    if constexpr (!is_fake_shared) {
680
11.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
11.4k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
11.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
11.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
11.4k
            _dependency = _shared_state->create_sink_dependency(
697
11.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
11.4k
        }
699
11.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
11.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
11.4k
    }
702
703
11.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
11.4k
    _rows_input_counter =
708
11.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
11.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
11.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
11.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
11.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
11.4k
    _memory_used_counter =
714
11.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
11.4k
    _common_profile->add_info_string("IsColocate",
716
11.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
11.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
11.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
11.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
11.4k
    return Status::OK();
721
11.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
426
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
426
    _operator_profile =
664
426
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
426
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
426
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
426
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
426
    _operator_profile->add_child(_common_profile, true);
673
426
    _operator_profile->add_child(_custom_profile, true);
674
675
426
    _operator_profile->set_metadata(_parent->node_id());
676
426
    _wait_for_finish_dependency_timer =
677
426
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
426
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
426
    if constexpr (!is_fake_shared) {
680
426
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
426
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
426
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
426
            _shared_state = info.shared_state->template cast<SharedState>();
696
426
            _dependency = _shared_state->create_sink_dependency(
697
426
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
426
        }
699
426
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
426
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
426
    }
702
703
427
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
426
    _rows_input_counter =
708
426
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
426
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
426
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
426
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
426
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
426
    _memory_used_counter =
714
426
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
426
    _common_profile->add_info_string("IsColocate",
716
426
                                     std::to_string(_parent->is_colocated_operator()));
717
426
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
426
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
426
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
426
    return Status::OK();
721
426
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.43k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.43k
    _operator_profile =
664
2.43k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.43k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.43k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2.43k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.43k
    _operator_profile->add_child(_common_profile, true);
673
2.43k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.43k
    _operator_profile->set_metadata(_parent->node_id());
676
2.43k
    _wait_for_finish_dependency_timer =
677
2.43k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.43k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.43k
    if constexpr (!is_fake_shared) {
680
2.43k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.43k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2.43k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.43k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.43k
            _dependency = _shared_state->create_sink_dependency(
697
2.43k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.43k
        }
699
2.43k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.43k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.43k
    }
702
703
2.44k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2.43k
    _rows_input_counter =
708
2.43k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.43k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.43k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.43k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.43k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.43k
    _memory_used_counter =
714
2.43k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.43k
    _common_profile->add_info_string("IsColocate",
716
2.43k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.43k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.43k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.43k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.43k
    return Status::OK();
721
2.43k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.6k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.6k
    _operator_profile =
664
12.6k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.6k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.6k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.6k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.6k
    _operator_profile->add_child(_common_profile, true);
673
12.6k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.6k
    _operator_profile->set_metadata(_parent->node_id());
676
12.6k
    _wait_for_finish_dependency_timer =
677
12.6k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.6k
    if constexpr (!is_fake_shared) {
680
12.6k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.6k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.6k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.6k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.6k
            _dependency = _shared_state->create_sink_dependency(
697
12.6k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.6k
        }
699
12.6k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.6k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.6k
    }
702
703
12.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.6k
    _rows_input_counter =
708
12.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.6k
    _memory_used_counter =
714
12.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.6k
    _common_profile->add_info_string("IsColocate",
716
12.6k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.6k
    return Status::OK();
721
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
237k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
237k
    _operator_profile =
664
237k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
237k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
237k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
237k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
237k
    _operator_profile->add_child(_common_profile, true);
673
237k
    _operator_profile->add_child(_custom_profile, true);
674
675
237k
    _operator_profile->set_metadata(_parent->node_id());
676
237k
    _wait_for_finish_dependency_timer =
677
237k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
237k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
237k
    if constexpr (!is_fake_shared) {
680
237k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
239k
            info.shared_state_map.end()) {
682
239k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
239k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
239k
            }
685
239k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
239k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
239k
                                                  ? 0
688
239k
                                                  : info.task_idx]
689
239k
                                  .get();
690
239k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
237k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
237k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
237k
    }
702
703
237k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
237k
    _rows_input_counter =
708
237k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
237k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
237k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
237k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
237k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
237k
    _memory_used_counter =
714
237k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
237k
    _common_profile->add_info_string("IsColocate",
716
237k
                                     std::to_string(_parent->is_colocated_operator()));
717
237k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
237k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
237k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
237k
    return Status::OK();
721
237k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
440k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
440k
    _operator_profile =
664
440k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
440k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
440k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
440k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
440k
    _operator_profile->add_child(_common_profile, true);
673
440k
    _operator_profile->add_child(_custom_profile, true);
674
675
440k
    _operator_profile->set_metadata(_parent->node_id());
676
440k
    _wait_for_finish_dependency_timer =
677
440k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
440k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
440k
    if constexpr (!is_fake_shared) {
680
440k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
440k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
440k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
440k
            _shared_state = info.shared_state->template cast<SharedState>();
696
440k
            _dependency = _shared_state->create_sink_dependency(
697
440k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
440k
        }
699
440k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
440k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
440k
    }
702
703
440k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
440k
    _rows_input_counter =
708
440k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
440k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
440k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
440k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
440k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
440k
    _memory_used_counter =
714
440k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
440k
    _common_profile->add_info_string("IsColocate",
716
440k
                                     std::to_string(_parent->is_colocated_operator()));
717
440k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
440k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
440k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
440k
    return Status::OK();
721
440k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
25
    _operator_profile =
664
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
25
    _operator_profile->add_child(_common_profile, true);
673
25
    _operator_profile->add_child(_custom_profile, true);
674
675
25
    _operator_profile->set_metadata(_parent->node_id());
676
25
    _wait_for_finish_dependency_timer =
677
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
25
    if constexpr (!is_fake_shared) {
680
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
25
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
25
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
25
            _shared_state = info.shared_state->template cast<SharedState>();
696
25
            _dependency = _shared_state->create_sink_dependency(
697
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
25
        }
699
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
25
    }
702
703
25
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
25
    _rows_input_counter =
708
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
25
    _memory_used_counter =
714
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
25
    _common_profile->add_info_string("IsColocate",
716
25
                                     std::to_string(_parent->is_colocated_operator()));
717
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
25
    return Status::OK();
721
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
338
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
338
    _operator_profile =
664
338
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
338
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
338
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
338
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
338
    _operator_profile->add_child(_common_profile, true);
673
338
    _operator_profile->add_child(_custom_profile, true);
674
675
338
    _operator_profile->set_metadata(_parent->node_id());
676
338
    _wait_for_finish_dependency_timer =
677
338
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
338
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
338
    if constexpr (!is_fake_shared) {
680
338
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
338
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
338
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
338
            _shared_state = info.shared_state->template cast<SharedState>();
696
338
            _dependency = _shared_state->create_sink_dependency(
697
338
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
338
        }
699
338
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
338
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
338
    }
702
703
338
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
338
    _rows_input_counter =
708
338
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
338
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
338
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
338
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
338
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
338
    _memory_used_counter =
714
338
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
338
    _common_profile->add_info_string("IsColocate",
716
338
                                     std::to_string(_parent->is_colocated_operator()));
717
338
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
338
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
338
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
338
    return Status::OK();
721
338
}
722
723
template <typename SharedState>
724
1.70M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.70M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.70M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.23M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.23M
    }
731
1.70M
    _closed = true;
732
1.70M
    return Status::OK();
733
1.70M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
114k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
114k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
114k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
114k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
114k
    }
731
114k
    _closed = true;
732
114k
    return Status::OK();
733
114k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1
    }
731
1
    _closed = true;
732
1
    return Status::OK();
733
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
197k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
197k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
197k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
197k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
197k
    }
731
197k
    _closed = true;
732
197k
    return Status::OK();
733
197k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
20
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
20
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
18
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
18
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
18
    }
731
18
    _closed = true;
732
18
    return Status::OK();
733
20
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.01k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.01k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.01k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.01k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.01k
    }
731
6.01k
    _closed = true;
732
6.01k
    return Status::OK();
733
6.01k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.79k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.79k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.79k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.79k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.79k
    }
731
7.79k
    _closed = true;
732
7.79k
    return Status::OK();
733
7.79k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
90.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
90.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
90.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
90.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
90.0k
    }
731
90.0k
    _closed = true;
732
90.0k
    return Status::OK();
733
90.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
104k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
104k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
104k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
104k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
104k
    }
731
104k
    _closed = true;
732
104k
    return Status::OK();
733
104k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
105
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
105
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
105
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
105
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
105
    }
731
105
    _closed = true;
732
105
    return Status::OK();
733
105
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
477k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
477k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
    }
731
477k
    _closed = true;
732
477k
    return Status::OK();
733
477k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
11.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
11.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
11.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
11.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
11.4k
    }
731
11.4k
    _closed = true;
732
11.4k
    return Status::OK();
733
11.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
325
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
325
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
325
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
325
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
325
    }
731
325
    _closed = true;
732
325
    return Status::OK();
733
325
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.49k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.49k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.49k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.49k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.49k
    }
731
2.49k
    _closed = true;
732
2.49k
    return Status::OK();
733
2.49k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.6k
    }
731
12.6k
    _closed = true;
732
12.6k
    return Status::OK();
733
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
239k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
239k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
239k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
239k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
239k
    }
731
239k
    _closed = true;
732
239k
    return Status::OK();
733
239k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
445k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
445k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
445k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
445k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
445k
    }
731
445k
    _closed = true;
732
445k
    return Status::OK();
733
445k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
14
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
14
    }
731
14
    _closed = true;
732
14
    return Status::OK();
733
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
338
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
338
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
338
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
338
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
338
    }
731
338
    _closed = true;
732
338
    return Status::OK();
733
338
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
7.23k
                                                          bool* eos) {
738
7.23k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.22k
    return pull(state, block, eos);
740
7.23k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
37
                                                          bool* eos) {
738
37
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
37
    return pull(state, block, eos);
740
37
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
7.19k
                                                          bool* eos) {
738
7.19k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
7.18k
    return pull(state, block, eos);
740
7.19k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
520k
                                                         bool* eos) {
745
520k
    auto& local_state = get_local_state(state);
746
520k
    if (need_more_input_data(state)) {
747
493k
        local_state._child_block->clear_column_data(
748
493k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
493k
                        .num_materialized_slots());
750
493k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
493k
                state, local_state._child_block.get(), &local_state._child_eos));
752
493k
        *eos = local_state._child_eos;
753
493k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
78.3k
            return Status::OK();
755
78.3k
        }
756
414k
        {
757
414k
            SCOPED_TIMER(local_state.exec_time_counter());
758
414k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
414k
        }
760
414k
    }
761
762
442k
    if (!need_more_input_data(state)) {
763
418k
        SCOPED_TIMER(local_state.exec_time_counter());
764
418k
        bool new_eos = false;
765
418k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
418k
        if (new_eos) {
767
343k
            *eos = true;
768
343k
        } else if (!need_more_input_data(state)) {
769
21.3k
            *eos = false;
770
21.3k
        }
771
418k
    }
772
442k
    return Status::OK();
773
442k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
130k
                                                         bool* eos) {
745
130k
    auto& local_state = get_local_state(state);
746
130k
    if (need_more_input_data(state)) {
747
114k
        local_state._child_block->clear_column_data(
748
114k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
114k
                        .num_materialized_slots());
750
114k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
114k
                state, local_state._child_block.get(), &local_state._child_eos));
752
114k
        *eos = local_state._child_eos;
753
114k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
31.8k
            return Status::OK();
755
31.8k
        }
756
83.0k
        {
757
83.0k
            SCOPED_TIMER(local_state.exec_time_counter());
758
83.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
83.0k
        }
760
83.0k
    }
761
762
98.8k
    if (!need_more_input_data(state)) {
763
98.8k
        SCOPED_TIMER(local_state.exec_time_counter());
764
98.8k
        bool new_eos = false;
765
98.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
98.8k
        if (new_eos) {
767
42.6k
            *eos = true;
768
56.2k
        } else if (!need_more_input_data(state)) {
769
8.83k
            *eos = false;
770
8.83k
        }
771
98.8k
    }
772
98.7k
    return Status::OK();
773
98.7k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.03k
                                                         bool* eos) {
745
4.03k
    auto& local_state = get_local_state(state);
746
4.03k
    if (need_more_input_data(state)) {
747
2.18k
        local_state._child_block->clear_column_data(
748
2.18k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.18k
                        .num_materialized_slots());
750
2.18k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.18k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.18k
        *eos = local_state._child_eos;
753
2.18k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
303
            return Status::OK();
755
303
        }
756
1.87k
        {
757
1.87k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.87k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.87k
        }
760
1.87k
    }
761
762
3.75k
    if (!need_more_input_data(state)) {
763
3.75k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.75k
        bool new_eos = false;
765
3.75k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.75k
        if (new_eos) {
767
1.25k
            *eos = true;
768
2.50k
        } else if (!need_more_input_data(state)) {
769
1.87k
            *eos = false;
770
1.87k
        }
771
3.75k
    }
772
3.73k
    return Status::OK();
773
3.73k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.91k
                                                         bool* eos) {
745
1.91k
    auto& local_state = get_local_state(state);
746
1.91k
    if (need_more_input_data(state)) {
747
1.91k
        local_state._child_block->clear_column_data(
748
1.91k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.91k
                        .num_materialized_slots());
750
1.91k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.91k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.91k
        *eos = local_state._child_eos;
753
1.91k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
775
            return Status::OK();
755
775
        }
756
1.14k
        {
757
1.14k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.14k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.14k
        }
760
1.14k
    }
761
762
1.14k
    if (!need_more_input_data(state)) {
763
1.14k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.14k
        bool new_eos = false;
765
1.14k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.14k
        if (new_eos) {
767
786
            *eos = true;
768
786
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.14k
    }
772
1.14k
    return Status::OK();
773
1.14k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
16.5k
                                                         bool* eos) {
745
16.5k
    auto& local_state = get_local_state(state);
746
16.6k
    if (need_more_input_data(state)) {
747
16.6k
        local_state._child_block->clear_column_data(
748
16.6k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
16.6k
                        .num_materialized_slots());
750
16.6k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
16.6k
                state, local_state._child_block.get(), &local_state._child_eos));
752
16.6k
        *eos = local_state._child_eos;
753
16.6k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
5.45k
            return Status::OK();
755
5.45k
        }
756
11.1k
        {
757
11.1k
            SCOPED_TIMER(local_state.exec_time_counter());
758
11.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
11.1k
        }
760
11.1k
    }
761
762
11.1k
    if (!need_more_input_data(state)) {
763
5.30k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.30k
        bool new_eos = false;
765
5.30k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.30k
        if (new_eos) {
767
5.26k
            *eos = true;
768
5.26k
        } else if (!need_more_input_data(state)) {
769
6
            *eos = false;
770
6
        }
771
5.30k
    }
772
11.1k
    return Status::OK();
773
11.1k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
338k
                                                         bool* eos) {
745
338k
    auto& local_state = get_local_state(state);
746
339k
    if (need_more_input_data(state)) {
747
339k
        local_state._child_block->clear_column_data(
748
339k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
339k
                        .num_materialized_slots());
750
339k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
339k
                state, local_state._child_block.get(), &local_state._child_eos));
752
339k
        *eos = local_state._child_eos;
753
339k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
38.2k
            return Status::OK();
755
38.2k
        }
756
301k
        {
757
301k
            SCOPED_TIMER(local_state.exec_time_counter());
758
301k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
301k
        }
760
301k
    }
761
762
300k
    if (!need_more_input_data(state)) {
763
282k
        SCOPED_TIMER(local_state.exec_time_counter());
764
282k
        bool new_eos = false;
765
282k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
282k
        if (new_eos) {
767
282k
            *eos = true;
768
282k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
282k
    }
772
300k
    return Status::OK();
773
300k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
21.4k
                                                         bool* eos) {
745
21.4k
    auto& local_state = get_local_state(state);
746
21.4k
    if (need_more_input_data(state)) {
747
11.1k
        local_state._child_block->clear_column_data(
748
11.1k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
11.1k
                        .num_materialized_slots());
750
11.1k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
11.1k
                state, local_state._child_block.get(), &local_state._child_eos));
752
11.1k
        *eos = local_state._child_eos;
753
11.1k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
931
            return Status::OK();
755
931
        }
756
10.1k
        {
757
10.1k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.1k
        }
760
10.1k
    }
761
762
20.4k
    if (!need_more_input_data(state)) {
763
19.9k
        SCOPED_TIMER(local_state.exec_time_counter());
764
19.9k
        bool new_eos = false;
765
19.9k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
19.9k
        if (new_eos) {
767
5.99k
            *eos = true;
768
13.9k
        } else if (!need_more_input_data(state)) {
769
10.3k
            *eos = false;
770
10.3k
        }
771
19.9k
    }
772
20.4k
    return Status::OK();
773
20.4k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.49k
                                                         bool* eos) {
745
7.49k
    auto& local_state = get_local_state(state);
746
7.49k
    if (need_more_input_data(state)) {
747
7.14k
        local_state._child_block->clear_column_data(
748
7.14k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
7.14k
                        .num_materialized_slots());
750
7.14k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
7.14k
                state, local_state._child_block.get(), &local_state._child_eos));
752
7.14k
        *eos = local_state._child_eos;
753
7.14k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
743
            return Status::OK();
755
743
        }
756
6.39k
        {
757
6.39k
            SCOPED_TIMER(local_state.exec_time_counter());
758
6.39k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
6.39k
        }
760
6.39k
    }
761
762
6.75k
    if (!need_more_input_data(state)) {
763
6.75k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.75k
        bool new_eos = false;
765
6.75k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.75k
        if (new_eos) {
767
4.63k
            *eos = true;
768
4.63k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.75k
    }
772
6.74k
    return Status::OK();
773
6.74k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
46.1k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.1k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.1k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.1k
                                                         "AsyncWriterDependency", true);
781
46.1k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.1k
                             _finish_dependency));
783
784
46.1k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.1k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.1k
    return Status::OK();
787
46.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
355
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
355
    RETURN_IF_ERROR(Base::init(state, info));
779
355
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
355
                                                         "AsyncWriterDependency", true);
781
355
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
355
                             _finish_dependency));
783
784
355
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
355
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
355
    return Status::OK();
787
355
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
45.8k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
45.8k
    RETURN_IF_ERROR(Base::init(state, info));
779
45.8k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
45.8k
                                                         "AsyncWriterDependency", true);
781
45.8k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
45.8k
                             _finish_dependency));
783
784
45.8k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
45.8k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
45.8k
    return Status::OK();
787
45.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
16
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
16
    RETURN_IF_ERROR(Base::init(state, info));
779
16
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
16
                                                         "AsyncWriterDependency", true);
781
16
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
16
                             _finish_dependency));
783
784
16
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
16
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
16
    return Status::OK();
787
16
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
46.6k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.6k
    RETURN_IF_ERROR(Base::open(state));
793
46.6k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
355k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
309k
        RETURN_IF_ERROR(
796
309k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
309k
    }
798
46.6k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.6k
    return Status::OK();
800
46.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
356
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
356
    RETURN_IF_ERROR(Base::open(state));
793
356
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.84k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.49k
        RETURN_IF_ERROR(
796
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.49k
    }
798
356
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
356
    return Status::OK();
800
356
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
46.2k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.2k
    RETURN_IF_ERROR(Base::open(state));
793
46.2k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
353k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
307k
        RETURN_IF_ERROR(
796
307k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
307k
    }
798
46.2k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.2k
    return Status::OK();
800
46.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
16
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
16
    RETURN_IF_ERROR(Base::open(state));
793
16
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
288
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
272
        RETURN_IF_ERROR(
796
272
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
272
    }
798
16
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
16
    return Status::OK();
800
16
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
62.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.0k
    return _writer->sink(block, eos);
806
62.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.68k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.68k
    return _writer->sink(block, eos);
806
1.68k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
60.3k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
60.3k
    return _writer->sink(block, eos);
806
60.3k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
16
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
16
    return _writer->sink(block, eos);
806
16
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
46.6k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
46.6k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
46.6k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
46.6k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
46.6k
    if (_writer) {
818
46.6k
        Status st = _writer->get_writer_status();
819
46.6k
        if (exec_status.ok()) {
820
46.5k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
46.5k
                                                       : Status::Cancelled("force close"));
822
46.5k
        } else {
823
56
            _writer->force_close(exec_status);
824
56
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
46.6k
        RETURN_IF_ERROR(st);
829
46.6k
    }
830
46.5k
    return Base::close(state, exec_status);
831
46.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
344
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
344
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
344
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
344
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
344
    if (_writer) {
818
344
        Status st = _writer->get_writer_status();
819
344
        if (exec_status.ok()) {
820
344
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
344
                                                       : Status::Cancelled("force close"));
822
344
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
344
        RETURN_IF_ERROR(st);
829
344
    }
830
344
    return Base::close(state, exec_status);
831
344
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
46.2k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
46.2k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
46.2k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
46.2k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
46.2k
    if (_writer) {
818
46.2k
        Status st = _writer->get_writer_status();
819
46.2k
        if (exec_status.ok()) {
820
46.2k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
46.2k
                                                       : Status::Cancelled("force close"));
822
46.2k
        } else {
823
56
            _writer->force_close(exec_status);
824
56
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
46.2k
        RETURN_IF_ERROR(st);
829
46.2k
    }
830
46.1k
    return Base::close(state, exec_status);
831
46.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
16
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
16
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
16
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
16
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
16
    if (_writer) {
818
16
        Status st = _writer->get_writer_status();
819
16
        if (exec_status.ok()) {
820
16
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
16
                                                       : Status::Cancelled("force close"));
822
16
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
16
        RETURN_IF_ERROR(st);
829
16
    }
830
16
    return Base::close(state, exec_status);
831
16
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
832
833
// An instantiation added outside the macros below needs the matching
834
// 'extern template' declaration in the operator's header (enforced by
835
// build-support/check-extern-template-pairing.py). Instantiations expanded
836
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
837
// skipped -- so their extern pairing has to be kept in sync by hand.
838
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
839
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
840
DECLARE_OPERATOR(ResultSinkLocalState)
841
DECLARE_OPERATOR(JdbcTableSinkLocalState)
842
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
843
DECLARE_OPERATOR(ResultFileSinkLocalState)
844
DECLARE_OPERATOR(OlapTableSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
846
DECLARE_OPERATOR(HiveTableSinkLocalState)
847
DECLARE_OPERATOR(TVFTableSinkLocalState)
848
DECLARE_OPERATOR(IcebergTableSinkLocalState)
849
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
850
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
851
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
852
DECLARE_OPERATOR(MCTableSinkLocalState)
853
DECLARE_OPERATOR(AnalyticSinkLocalState)
854
DECLARE_OPERATOR(BlackholeSinkLocalState)
855
DECLARE_OPERATOR(SortSinkLocalState)
856
DECLARE_OPERATOR(SpillSortSinkLocalState)
857
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
858
DECLARE_OPERATOR(AggSinkLocalState)
859
DECLARE_OPERATOR(BucketedAggSinkLocalState)
860
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
861
DECLARE_OPERATOR(ExchangeSinkLocalState)
862
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
863
DECLARE_OPERATOR(UnionSinkLocalState)
864
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
865
DECLARE_OPERATOR(PartitionSortSinkLocalState)
866
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
867
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
868
DECLARE_OPERATOR(SetSinkLocalState<true>)
869
DECLARE_OPERATOR(SetSinkLocalState<false>)
870
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
871
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
872
DECLARE_OPERATOR(CacheSinkLocalState)
873
DECLARE_OPERATOR(DictSinkLocalState)
874
DECLARE_OPERATOR(RecCTESinkLocalState)
875
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
876
877
#undef DECLARE_OPERATOR
878
879
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
880
DECLARE_OPERATOR(HashJoinProbeLocalState)
881
DECLARE_OPERATOR(OlapScanLocalState)
882
DECLARE_OPERATOR(GroupCommitLocalState)
883
DECLARE_OPERATOR(JDBCScanLocalState)
884
DECLARE_OPERATOR(FileScanLocalState)
885
DECLARE_OPERATOR(AnalyticLocalState)
886
DECLARE_OPERATOR(SortLocalState)
887
DECLARE_OPERATOR(SpillSortLocalState)
888
DECLARE_OPERATOR(LocalMergeSortLocalState)
889
DECLARE_OPERATOR(AggLocalState)
890
DECLARE_OPERATOR(BucketedAggLocalState)
891
DECLARE_OPERATOR(PartitionedAggLocalState)
892
DECLARE_OPERATOR(TableFunctionLocalState)
893
DECLARE_OPERATOR(ExchangeLocalState)
894
DECLARE_OPERATOR(RepeatLocalState)
895
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
896
DECLARE_OPERATOR(AssertNumRowsLocalState)
897
DECLARE_OPERATOR(EmptySetLocalState)
898
DECLARE_OPERATOR(UnionSourceLocalState)
899
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
900
DECLARE_OPERATOR(PartitionSortSourceLocalState)
901
DECLARE_OPERATOR(SetSourceLocalState<true>)
902
DECLARE_OPERATOR(SetSourceLocalState<false>)
903
DECLARE_OPERATOR(DataGenLocalState)
904
DECLARE_OPERATOR(SchemaScanLocalState)
905
DECLARE_OPERATOR(MetaScanLocalState)
906
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
907
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
908
DECLARE_OPERATOR(CacheSourceLocalState)
909
DECLARE_OPERATOR(RecCTESourceLocalState)
910
DECLARE_OPERATOR(RecCTEScanLocalState)
911
912
#ifdef BE_TEST
913
DECLARE_OPERATOR(MockLocalState)
914
DECLARE_OPERATOR(MockScanLocalState)
915
#endif
916
#undef DECLARE_OPERATOR
917
918
template class StreamingOperatorX<AssertNumRowsLocalState>;
919
template class StreamingOperatorX<SelectLocalState>;
920
921
template class StatefulOperatorX<HashJoinProbeLocalState>;
922
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
923
template class StatefulOperatorX<RepeatLocalState>;
924
template class StatefulOperatorX<MaterializationLocalState>;
925
template class StatefulOperatorX<StreamingAggLocalState>;
926
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
927
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
928
template class StatefulOperatorX<TableFunctionLocalState>;
929
930
template class PipelineXSinkLocalState<HashJoinSharedState>;
931
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
932
template class PipelineXSinkLocalState<SortSharedState>;
933
template class PipelineXSinkLocalState<SpillSortSharedState>;
934
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
935
template class PipelineXSinkLocalState<AnalyticSharedState>;
936
template class PipelineXSinkLocalState<AggSharedState>;
937
template class PipelineXSinkLocalState<BucketedAggSharedState>;
938
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
939
template class PipelineXSinkLocalState<FakeSharedState>;
940
template class PipelineXSinkLocalState<UnionSharedState>;
941
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
942
template class PipelineXSinkLocalState<MultiCastSharedState>;
943
template class PipelineXSinkLocalState<SetSharedState>;
944
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
945
template class PipelineXSinkLocalState<BasicSharedState>;
946
template class PipelineXSinkLocalState<DataQueueSharedState>;
947
template class PipelineXSinkLocalState<RecCTESharedState>;
948
949
template class PipelineXLocalState<HashJoinSharedState>;
950
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
951
template class PipelineXLocalState<SortSharedState>;
952
template class PipelineXLocalState<SpillSortSharedState>;
953
template class PipelineXLocalState<NestedLoopJoinSharedState>;
954
template class PipelineXLocalState<AnalyticSharedState>;
955
template class PipelineXLocalState<AggSharedState>;
956
template class PipelineXLocalState<BucketedAggSharedState>;
957
template class PipelineXLocalState<PartitionedAggSharedState>;
958
template class PipelineXLocalState<FakeSharedState>;
959
template class PipelineXLocalState<UnionSharedState>;
960
template class PipelineXLocalState<DataQueueSharedState>;
961
template class PipelineXLocalState<MultiCastSharedState>;
962
template class PipelineXLocalState<PartitionSortNodeSharedState>;
963
template class PipelineXLocalState<SetSharedState>;
964
template class PipelineXLocalState<LocalExchangeSharedState>;
965
template class PipelineXLocalState<BasicSharedState>;
966
template class PipelineXLocalState<RecCTESharedState>;
967
968
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
969
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
970
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
971
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
972
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
973
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
974
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
977
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
978
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
979
980
#ifdef BE_TEST
981
template class OperatorX<DummyOperatorLocalState>;
982
template class DataSinkOperatorX<DummySinkLocalState>;
983
#endif
984
985
} // namespace doris