Coverage Report

Created: 2026-10-16 05:17

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/paimon_table_sink_operator.h"
68
#include "exec/operator/partition_sort_sink_operator.h"
69
#include "exec/operator/partition_sort_source_operator.h"
70
#include "exec/operator/partitioned_aggregation_sink_operator.h"
71
#include "exec/operator/partitioned_aggregation_source_operator.h"
72
#include "exec/operator/partitioned_hash_join_probe_operator.h"
73
#include "exec/operator/partitioned_hash_join_sink_operator.h"
74
#include "exec/operator/rec_cte_anchor_sink_operator.h"
75
#include "exec/operator/rec_cte_scan_operator.h"
76
#include "exec/operator/rec_cte_sink_operator.h"
77
#include "exec/operator/rec_cte_source_operator.h"
78
#include "exec/operator/repeat_operator.h"
79
#include "exec/operator/result_file_sink_operator.h"
80
#include "exec/operator/result_sink_operator.h"
81
#include "exec/operator/schema_scan_operator.h"
82
#include "exec/operator/select_operator.h"
83
#include "exec/operator/set_probe_sink_operator.h"
84
#include "exec/operator/set_sink_operator.h"
85
#include "exec/operator/set_source_operator.h"
86
#include "exec/operator/sort_sink_operator.h"
87
#include "exec/operator/sort_source_operator.h"
88
#include "exec/operator/spill_iceberg_table_sink_operator.h"
89
#include "exec/operator/spill_sort_sink_operator.h"
90
#include "exec/operator/spill_sort_source_operator.h"
91
#include "exec/operator/streaming_aggregation_operator.h"
92
#include "exec/operator/table_function_operator.h"
93
#include "exec/operator/tvf_table_sink_operator.h"
94
#include "exec/operator/union_sink_operator.h"
95
#include "exec/operator/union_source_operator.h"
96
#include "exec/pipeline/dependency.h"
97
#include "exec/pipeline/pipeline.h"
98
#include "exprs/vexpr.h"
99
#include "exprs/vexpr_context.h"
100
#include "runtime/runtime_profile.h"
101
#include "runtime/runtime_profile_counter_names.h"
102
#include "util/debug_util.h"
103
#include "util/string_util.h"
104
105
namespace doris {
106
class RowDescriptor;
107
class RuntimeState;
108
} // namespace doris
109
110
namespace doris {
111
112
0
Status OperatorBase::close(RuntimeState* state) {
113
0
    if (_is_closed) {
114
0
        return Status::OK();
115
0
    }
116
0
    _is_closed = true;
117
0
    return Status::OK();
118
0
}
119
120
template <typename SharedStateArg>
121
1.78M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
1.78M
    if (_parent->nereids_id() == -1) {
123
926k
        return fmt::format("(id={})", _parent->node_id());
124
926k
    } else {
125
857k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
857k
    }
127
1.78M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
68.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
68.9k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
68.9k
    } else {
125
68.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
68.9k
    }
127
68.9k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
1
    if (_parent->nereids_id() == -1) {
123
1
        return fmt::format("(id={})", _parent->node_id());
124
1
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
245k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
245k
    if (_parent->nereids_id() == -1) {
123
12
        return fmt::format("(id={})", _parent->node_id());
124
245k
    } else {
125
245k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
245k
    }
127
245k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
30
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
30
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
30
    } else {
125
30
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
30
    }
127
30
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
5.85k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
5.85k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
5.85k
    } else {
125
5.85k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
5.85k
    }
127
5.85k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
9.96k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
9.96k
    if (_parent->nereids_id() == -1) {
123
16
        return fmt::format("(id={})", _parent->node_id());
124
9.95k
    } else {
125
9.95k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
9.95k
    }
127
9.96k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
100k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
100k
    if (_parent->nereids_id() == -1) {
123
29
        return fmt::format("(id={})", _parent->node_id());
124
100k
    } else {
125
100k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
100k
    }
127
100k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
58.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
58.8k
    if (_parent->nereids_id() == -1) {
123
2
        return fmt::format("(id={})", _parent->node_id());
124
58.8k
    } else {
125
58.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
58.8k
    }
127
58.8k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
54
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
54
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
54
    } else {
125
54
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
54
    }
127
54
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
588k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
588k
    if (_parent->nereids_id() == -1) {
123
282k
        return fmt::format("(id={})", _parent->node_id());
124
306k
    } else {
125
306k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
306k
    }
127
588k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
55.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
55.9k
    if (_parent->nereids_id() == -1) {
123
2
        return fmt::format("(id={})", _parent->node_id());
124
55.9k
    } else {
125
55.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
55.9k
    }
127
55.9k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
26
    if (_parent->nereids_id() == -1) {
123
26
        return fmt::format("(id={})", _parent->node_id());
124
26
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
5.30k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
5.31k
    if (_parent->nereids_id() == -1) {
123
5.31k
        return fmt::format("(id={})", _parent->node_id());
124
18.4E
    } else {
125
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
18.4E
    }
127
5.30k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
708
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
708
    if (_parent->nereids_id() == -1) {
123
102
        return fmt::format("(id={})", _parent->node_id());
124
606
    } else {
125
606
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
606
    }
127
708
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
5.08k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
5.08k
    if (_parent->nereids_id() == -1) {
123
13
        return fmt::format("(id={})", _parent->node_id());
124
5.06k
    } else {
125
5.06k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
5.06k
    }
127
5.08k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
639k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
639k
    if (_parent->nereids_id() == -1) {
123
638k
        return fmt::format("(id={})", _parent->node_id());
124
638k
    } else {
125
726
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
726
    }
127
639k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
169
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
169
    } else {
125
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
169
    }
127
169
}
128
129
template <typename SharedStateArg>
130
1.21M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
1.21M
    if (_parent->nereids_id() == -1) {
132
662k
        return fmt::format("(id={})", _parent->node_id());
133
662k
    } else {
134
550k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
550k
    }
136
1.21M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
117k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
117k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
117k
    } else {
134
117k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
117k
    }
136
117k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
2
    if (_parent->nereids_id() == -1) {
132
1
        return fmt::format("(id={})", _parent->node_id());
133
1
    } else {
134
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
1
    }
136
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
247k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
247k
    if (_parent->nereids_id() == -1) {
132
9
        return fmt::format("(id={})", _parent->node_id());
133
247k
    } else {
134
247k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
247k
    }
136
247k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
37
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
37
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
37
    } else {
134
37
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
37
    }
136
37
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
5.88k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
5.88k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
5.88k
    } else {
134
5.88k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
5.88k
    }
136
5.88k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
10.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
10.0k
    if (_parent->nereids_id() == -1) {
132
16
        return fmt::format("(id={})", _parent->node_id());
133
10.0k
    } else {
134
10.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
10.0k
    }
136
10.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
100k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
100k
    if (_parent->nereids_id() == -1) {
132
29
        return fmt::format("(id={})", _parent->node_id());
133
100k
    } else {
134
100k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
100k
    }
136
100k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
58.7k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
58.7k
    if (_parent->nereids_id() == -1) {
132
4
        return fmt::format("(id={})", _parent->node_id());
133
58.7k
    } else {
134
58.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
58.7k
    }
136
58.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
64
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
64
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
64
    } else {
134
64
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
64
    }
136
64
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
18
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
18
    if (_parent->nereids_id() == -1) {
132
18
        return fmt::format("(id={})", _parent->node_id());
133
18
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
11.1k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
11.1k
    if (_parent->nereids_id() == -1) {
132
3
        return fmt::format("(id={})", _parent->node_id());
133
11.1k
    } else {
134
11.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
11.1k
    }
136
11.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
708
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
708
    if (_parent->nereids_id() == -1) {
132
102
        return fmt::format("(id={})", _parent->node_id());
133
606
    } else {
134
606
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
606
    }
136
708
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
12.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
12.3k
    if (_parent->nereids_id() == -1) {
132
12.3k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
12.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
242k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
242k
    if (_parent->nereids_id() == -1) {
132
242k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
242k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
406k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
406k
    if (_parent->nereids_id() == -1) {
132
406k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
406k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
25
    if (_parent->nereids_id() == -1) {
132
25
        return fmt::format("(id={})", _parent->node_id());
133
25
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
338
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
338
    } else {
134
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
338
    }
136
338
}
137
138
template <typename SharedStateArg>
139
31.2k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
31.2k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
31.2k
    _terminated = true;
144
31.2k
    return Status::OK();
145
31.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
24.0k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
24.0k
    _terminated = true;
144
24.0k
    return Status::OK();
145
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
3.35k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
3.35k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
3.35k
    _terminated = true;
144
3.35k
    return Status::OK();
145
3.35k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
2
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
2
    _terminated = true;
144
2
    return Status::OK();
145
2
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
1.97k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
1.97k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
1.97k
    _terminated = true;
144
1.97k
    return Status::OK();
145
1.97k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
600
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
600
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
600
    _terminated = true;
144
600
    return Status::OK();
145
600
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
373
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
373
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
373
    _terminated = true;
144
373
    return Status::OK();
145
373
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
355
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
355
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
355
    _terminated = true;
144
355
    return Status::OK();
145
355
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
5
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
5
    _terminated = true;
144
5
    return Status::OK();
145
5
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
105
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
105
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
105
    _terminated = true;
144
105
    return Status::OK();
145
105
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
5
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
5
    _terminated = true;
144
5
    return Status::OK();
145
5
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
235
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
235
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
235
    _terminated = true;
144
235
    return Status::OK();
145
235
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
131
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
131
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
131
    _terminated = true;
144
131
    return Status::OK();
145
131
}
146
147
317k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
148
317k
    return _child && _child->is_serial_operator() && !is_source()
149
317k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
150
317k
                   : DataDistribution(TLocalPartitionType::NOOP);
151
317k
}
152
153
26.9k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
154
26.9k
    if (!_child) {
155
25.8k
        return false;
156
25.8k
    }
157
1.05k
    if (_child->is_serial_operator()) {
158
104
        return true;
159
104
    }
160
950
    const auto child_distribution = _child->required_data_distribution(state);
161
950
    return child_distribution.need_local_exchange() &&
162
950
           !is_shuffled_exchange(child_distribution.distribution_type);
163
1.05k
}
164
165
template <typename SharedStateArg>
166
16.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
16.5k
    fmt::memory_buffer debug_string_buffer;
168
16.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
16.5k
    return fmt::to_string(debug_string_buffer);
170
16.5k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
166
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
3
    fmt::memory_buffer debug_string_buffer;
168
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
3
    return fmt::to_string(debug_string_buffer);
170
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
166
16.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
16.5k
    fmt::memory_buffer debug_string_buffer;
168
16.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
16.5k
    return fmt::to_string(debug_string_buffer);
170
16.5k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
166
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
1
    fmt::memory_buffer debug_string_buffer;
168
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
1
    return fmt::to_string(debug_string_buffer);
170
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
171
172
template <typename SharedStateArg>
173
16.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
174
16.5k
    fmt::memory_buffer debug_string_buffer;
175
16.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
176
16.5k
    return fmt::to_string(debug_string_buffer);
177
16.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
173
16.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
174
16.5k
    fmt::memory_buffer debug_string_buffer;
175
16.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
176
16.5k
    return fmt::to_string(debug_string_buffer);
177
16.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
178
179
16.5k
std::string OperatorXBase::debug_string(int indentation_level) const {
180
16.5k
    fmt::memory_buffer debug_string_buffer;
181
16.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
182
16.5k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
183
16.5k
                   _is_serial_operator);
184
16.5k
    return fmt::to_string(debug_string_buffer);
185
16.5k
}
186
187
16.5k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
188
16.5k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
189
16.5k
}
190
191
694k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
192
694k
    std::string node_name = print_plan_node_type(tnode.node_type);
193
694k
    _nereids_id = tnode.nereids_id;
194
694k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
195
6.61k
        if (!has_projection()) {
196
0
            return Status::InternalError("no final output tuple id");
197
0
        }
198
6.61k
        if (tnode.intermediate_output_tuple_id_list.size() !=
199
6.61k
            tnode.intermediate_projections_list.size()) {
200
0
            return Status::InternalError(
201
0
                    "intermediate_output_tuple_id_list size:{} not match "
202
0
                    "intermediate_projections_list size:{}",
203
0
                    tnode.intermediate_output_tuple_id_list.size(),
204
0
                    tnode.intermediate_projections_list.size());
205
0
        }
206
6.61k
    }
207
694k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
208
694k
    _op_name = substr + "_OPERATOR";
209
210
694k
    if (tnode.__isset.vconjunct) {
211
0
        return Status::InternalError("vconjunct is not supported yet");
212
694k
    } else if (tnode.__isset.conjuncts) {
213
281k
        for (const auto& conjunct : tnode.conjuncts) {
214
281k
            VExprContextSPtr context;
215
281k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
216
281k
            _conjuncts.emplace_back(context);
217
281k
        }
218
104k
    }
219
220
    // create the projections expr
221
694k
    if (tnode.__isset.projections) {
222
273k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
223
273k
    }
224
694k
    if (!tnode.intermediate_projections_list.empty()) {
225
6.61k
        DCHECK(has_projection()) << "no final projections";
226
6.61k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
227
11.7k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
228
11.7k
            VExprContextSPtrs projections;
229
11.7k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
230
11.7k
            _projection->intermediate_projections.push_back(projections);
231
11.7k
        }
232
6.61k
    }
233
694k
    return Status::OK();
234
694k
}
235
236
721k
Status OperatorXBase::prepare(RuntimeState* state) {
237
721k
    for (auto& conjunct : _conjuncts) {
238
281k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
239
281k
    }
240
721k
    if (state->enable_adjust_conjunct_order_by_cost()) {
241
671k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
242
344k
            return a->execute_cost() < b->execute_cost();
243
344k
        });
244
671k
    };
245
246
721k
    if (has_projection()) {
247
273k
        auto& projection = *_projection;
248
284k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
249
11.7k
            const auto& input_row_desc =
250
11.7k
                    i == 0 ? operator_row_desc_before_projection()
251
11.7k
                           : projection.intermediate_output_row_descriptors[i - 1];
252
11.7k
            RETURN_IF_ERROR(
253
11.7k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
254
11.7k
        }
255
273k
        const auto& final_projection_input_row_desc =
256
273k
                projection.intermediate_output_row_descriptors.empty()
257
273k
                        ? operator_row_desc_before_projection()
258
273k
                        : projection.intermediate_output_row_descriptors.back();
259
273k
        RETURN_IF_ERROR(
260
273k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
261
273k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
262
273k
                                                      projection.output_row_descriptor));
263
273k
    }
264
265
721k
    for (auto& conjunct : _conjuncts) {
266
281k
        RETURN_IF_ERROR(conjunct->open(state));
267
281k
    }
268
721k
    if (has_projection()) {
269
273k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
270
273k
        for (auto& projections : _projection->intermediate_projections) {
271
11.7k
            RETURN_IF_ERROR(VExpr::open(projections, state));
272
11.7k
        }
273
273k
    }
274
721k
    if (_child && !is_source()) {
275
99.3k
        RETURN_IF_ERROR(_child->prepare(state));
276
99.3k
    }
277
278
721k
    if (VExpr::contains_blockable_function(_conjuncts) ||
279
721k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
280
0
        _blockable = true;
281
0
    }
282
283
721k
    return Status::OK();
284
721k
}
285
286
7.86k
Status OperatorXBase::terminate(RuntimeState* state) {
287
7.86k
    if (_child && !is_source()) {
288
657
        RETURN_IF_ERROR(_child->terminate(state));
289
657
    }
290
7.86k
    auto result = state->get_local_state_result(operator_id());
291
7.86k
    if (!result) {
292
0
        return result.error();
293
0
    }
294
7.86k
    return result.value()->terminate(state);
295
7.86k
}
296
297
4.78M
Status OperatorXBase::close(RuntimeState* state) {
298
4.78M
    if (_child && !is_source()) {
299
737k
        RETURN_IF_ERROR(_child->close(state));
300
737k
    }
301
4.78M
    auto result = state->get_local_state_result(operator_id());
302
4.78M
    if (!result) {
303
0
        return result.error();
304
0
    }
305
4.78M
    return result.value()->close(state);
306
4.78M
}
307
308
275k
void PipelineXLocalStateBase::clear_origin_block() {
309
275k
    _origin_block.clear_column_data(_parent->operator_row_desc_before_projection().num_slots());
310
275k
}
311
312
678k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
678k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
678k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
678k
    return Status::OK();
317
678k
}
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
275k
                                     Block* output_block) const {
326
275k
    auto* local_state = state->get_local_state(operator_id());
327
275k
    SCOPED_TIMER(local_state->exec_time_counter());
328
275k
    SCOPED_TIMER(local_state->_projection_timer);
329
275k
    const size_t rows = origin_block->rows();
330
275k
    if (rows == 0) {
331
141k
        return Status::OK();
332
141k
    }
333
133k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
133k
    {
336
133k
        Block input_block = *origin_block;
337
338
133k
        ColumnsWithTypeAndName new_columns;
339
133k
        for (const auto& projections : local_state->_intermediate_projections) {
340
4.77k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
4.77k
            new_columns.resize(projections.size());
345
80.3k
            for (int i = 0; i < projections.size(); i++) {
346
75.5k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
75.5k
                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
75.5k
            }
355
4.76k
            Block tmp_block {new_columns};
356
4.76k
            input_block.swap(tmp_block);
357
4.76k
        }
358
359
133k
        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
133k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
133k
                output_block, _projection->output_row_descriptor);
368
133k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
133k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
133k
        Columns shared_columns(mutable_columns.size());
371
372
772k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
639k
            ColumnPtr column_ptr;
374
639k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
639k
            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
639k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
639k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
639k
            if (column_ptr->is_exclusive()) {
386
234k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
404k
            } else {
388
404k
                shared_columns[i] = std::move(column_ptr);
389
404k
            }
390
639k
        }
391
392
133k
        scoped_mutable_block.restore();
393
772k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
639k
            if (shared_columns[i]) {
395
404k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
404k
            }
397
639k
        }
398
133k
    }
399
400
0
    origin_block->clear_column_data(
401
133k
            local_state->_parent->operator_row_desc_before_projection().num_slots());
402
133k
    DCHECK_EQ(output_block->rows(), rows);
403
404
133k
    return Status::OK();
405
133k
}
406
407
4.08M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.08M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.08M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.08M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.08M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.08M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.08M
            if (_debug_point_count++ % 2 == 0) {
414
4.08M
                return Status::OK();
415
4.08M
            }
416
4.08M
        }
417
4.08M
    });
418
419
4.08M
    Status status;
420
4.08M
    auto* local_state = state->get_local_state(operator_id());
421
4.08M
    Defer defer([&]() {
422
4.08M
        if (status.ok()) {
423
4.08M
            local_state->update_output_block_counters(*block);
424
4.08M
        }
425
4.08M
    });
426
4.08M
    if (has_projection()) {
427
275k
        local_state->clear_origin_block();
428
275k
        status = get_block(state, &local_state->_origin_block, eos);
429
275k
        if (UNLIKELY(!status.ok())) {
430
24
            return status;
431
24
        }
432
275k
        status = do_projections(state, &local_state->_origin_block, block);
433
275k
        return status;
434
275k
    }
435
3.81M
    status = get_block(state, block, eos);
436
3.81M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.81M
    return status;
438
3.81M
}
439
440
2.70M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.70M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.89k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.89k
        *eos = true;
444
9.89k
    }
445
446
2.70M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.70M
        auto op_name = to_lower(_parent->_op_name);
448
2.70M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.70M
        arg_op_name = to_lower(arg_op_name);
450
451
2.70M
        if (op_name == arg_op_name) {
452
2.70M
            *eos = true;
453
2.70M
        }
454
2.70M
    });
455
456
2.70M
    if (auto rows = block->rows()) {
457
762k
        _num_rows_returned += rows;
458
762k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
762k
    }
460
2.70M
}
461
462
31.2k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
31.2k
    auto result = state->get_sink_local_state_result();
464
31.2k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
31.2k
    return result.value()->terminate(state);
468
31.2k
}
469
470
16.5k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
16.5k
    fmt::memory_buffer debug_string_buffer;
472
473
16.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
16.5k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
16.5k
    return fmt::to_string(debug_string_buffer);
476
16.5k
}
477
478
16.5k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
16.5k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
16.5k
}
481
482
361k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
361k
    std::string op_name = "UNKNOWN_SINK";
484
361k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
361k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
361k
        op_name = it->second;
488
361k
    }
489
361k
    _name = op_name + "_OPERATOR";
490
361k
    return Status::OK();
491
361k
}
492
493
307k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
307k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
307k
    _nereids_id = tnode.nereids_id;
496
307k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
307k
    _name = substr + "_SINK_OPERATOR";
498
307k
    return Status::OK();
499
307k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.75M
                                                            LocalSinkStateInfo& info) {
504
1.75M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.75M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.75M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.75M
    return Status::OK();
508
1.75M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
117k
                                                            LocalSinkStateInfo& info) {
504
117k
    auto local_state = LocalStateType::create_unique(this, state);
505
117k
    RETURN_IF_ERROR(local_state->init(state, info));
506
117k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
117k
    return Status::OK();
508
117k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
359k
                                                            LocalSinkStateInfo& info) {
504
359k
    auto local_state = LocalStateType::create_unique(this, state);
505
359k
    RETURN_IF_ERROR(local_state->init(state, info));
506
359k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
359k
    return Status::OK();
508
359k
}
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
364
                                                            LocalSinkStateInfo& info) {
504
364
    auto local_state = LocalStateType::create_unique(this, state);
505
364
    RETURN_IF_ERROR(local_state->init(state, info));
506
364
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
364
    return Status::OK();
508
364
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
47.5k
                                                            LocalSinkStateInfo& info) {
504
47.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
47.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
47.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
47.5k
    return Status::OK();
508
47.5k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8
                                                            LocalSinkStateInfo& info) {
504
8
    auto local_state = LocalStateType::create_unique(this, state);
505
8
    RETURN_IF_ERROR(local_state->init(state, info));
506
8
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8
    return Status::OK();
508
8
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25PaimonTableSinkLocalStateEE17setup_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
10.0k
                                                            LocalSinkStateInfo& info) {
504
10.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
10.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
10.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
10.0k
    return Status::OK();
508
10.0k
}
_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
247k
                                                            LocalSinkStateInfo& info) {
504
247k
    auto local_state = LocalStateType::create_unique(this, state);
505
247k
    RETURN_IF_ERROR(local_state->init(state, info));
506
247k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
247k
    return Status::OK();
508
247k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
37
                                                            LocalSinkStateInfo& info) {
504
37
    auto local_state = LocalStateType::create_unique(this, state);
505
37
    RETURN_IF_ERROR(local_state->init(state, info));
506
37
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
37
    return Status::OK();
508
37
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
242k
                                                            LocalSinkStateInfo& info) {
504
242k
    auto local_state = LocalStateType::create_unique(this, state);
505
242k
    RETURN_IF_ERROR(local_state->init(state, info));
506
242k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
242k
    return Status::OK();
508
242k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
100k
                                                            LocalSinkStateInfo& info) {
504
100k
    auto local_state = LocalStateType::create_unique(this, state);
505
100k
    RETURN_IF_ERROR(local_state->init(state, info));
506
100k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
100k
    return Status::OK();
508
100k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
58.7k
                                                            LocalSinkStateInfo& info) {
504
58.7k
    auto local_state = LocalStateType::create_unique(this, state);
505
58.7k
    RETURN_IF_ERROR(local_state->init(state, info));
506
58.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
58.7k
    return Status::OK();
508
58.7k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
64
                                                            LocalSinkStateInfo& info) {
504
64
    auto local_state = LocalStateType::create_unique(this, state);
505
64
    RETURN_IF_ERROR(local_state->init(state, info));
506
64
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
64
    return Status::OK();
508
64
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
536k
                                                            LocalSinkStateInfo& info) {
504
536k
    auto local_state = LocalStateType::create_unique(this, state);
505
536k
    RETURN_IF_ERROR(local_state->init(state, info));
506
536k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
536k
    return Status::OK();
508
536k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.89k
                                                            LocalSinkStateInfo& info) {
504
5.89k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.89k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.89k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.89k
    return Status::OK();
508
5.89k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
11.1k
                                                            LocalSinkStateInfo& info) {
504
11.1k
    auto local_state = LocalStateType::create_unique(this, state);
505
11.1k
    RETURN_IF_ERROR(local_state->init(state, info));
506
11.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
11.1k
    return Status::OK();
508
11.1k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.07k
                                                            LocalSinkStateInfo& info) {
504
2.07k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.07k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.07k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.07k
    return Status::OK();
508
2.07k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
608
                                                            LocalSinkStateInfo& info) {
504
608
    auto local_state = LocalStateType::create_unique(this, state);
505
608
    RETURN_IF_ERROR(local_state->init(state, info));
506
608
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
608
    return Status::OK();
508
608
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.71k
                                                            LocalSinkStateInfo& info) {
504
4.71k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.71k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.71k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.71k
    return Status::OK();
508
4.71k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.54k
                                                            LocalSinkStateInfo& info) {
504
2.54k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.54k
    return Status::OK();
508
2.54k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.54k
                                                            LocalSinkStateInfo& info) {
504
2.54k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.54k
    return Status::OK();
508
2.54k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.50k
                                                            LocalSinkStateInfo& info) {
504
2.50k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.50k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.50k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.50k
    return Status::OK();
508
2.50k
}
_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
567
                                                            LocalSinkStateInfo& info) {
504
567
    auto local_state = LocalStateType::create_unique(this, state);
505
567
    RETURN_IF_ERROR(local_state->init(state, info));
506
567
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
567
    return Status::OK();
508
567
}
_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.42M
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.42M
    } else {
519
1.42M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.42M
        ss->id = operator_id();
521
1.42M
        for (auto& dest : dests_id()) {
522
1.41M
            ss->related_op_ids.insert(dest);
523
1.41M
        }
524
1.42M
        return ss;
525
1.42M
    }
526
1.42M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
104k
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
104k
    } else {
519
104k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
104k
        ss->id = operator_id();
521
104k
        for (auto& dest : dests_id()) {
522
104k
            ss->related_op_ids.insert(dest);
523
104k
        }
524
104k
        return ss;
525
104k
    }
526
104k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
359k
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
359k
    } else {
519
359k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
359k
        ss->id = operator_id();
521
359k
        for (auto& dest : dests_id()) {
522
358k
            ss->related_op_ids.insert(dest);
523
358k
        }
524
359k
        return ss;
525
359k
    }
526
359k
}
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
364
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
364
    } else {
519
364
        auto ss = LocalStateType::SharedStateType::create_shared();
520
364
        ss->id = operator_id();
521
364
        for (auto& dest : dests_id()) {
522
363
            ss->related_op_ids.insert(dest);
523
363
        }
524
364
        return ss;
525
364
    }
526
364
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
47.6k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
47.6k
    } else {
519
47.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
47.6k
        ss->id = operator_id();
521
47.6k
        for (auto& dest : dests_id()) {
522
47.3k
            ss->related_op_ids.insert(dest);
523
47.3k
        }
524
47.6k
        return ss;
525
47.6k
    }
526
47.6k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
8
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8
    } else {
519
8
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8
        ss->id = operator_id();
521
8
        for (auto& dest : dests_id()) {
522
8
            ss->related_op_ids.insert(dest);
523
8
        }
524
8
        return ss;
525
8
    }
526
8
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25PaimonTableSinkLocalStateEE19create_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
10.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
10.0k
    } else {
519
10.0k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
10.0k
        ss->id = operator_id();
521
10.0k
        for (auto& dest : dests_id()) {
522
10.0k
            ss->related_op_ids.insert(dest);
523
10.0k
        }
524
10.0k
        return ss;
525
10.0k
    }
526
10.0k
}
_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
248k
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
248k
    } else {
519
248k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
248k
        ss->id = operator_id();
521
248k
        for (auto& dest : dests_id()) {
522
247k
            ss->related_op_ids.insert(dest);
523
247k
        }
524
248k
        return ss;
525
248k
    }
526
248k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
39
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
39
    } else {
519
39
        auto ss = LocalStateType::SharedStateType::create_shared();
520
39
        ss->id = operator_id();
521
39
        for (auto& dest : dests_id()) {
522
39
            ss->related_op_ids.insert(dest);
523
39
        }
524
39
        return ss;
525
39
    }
526
39
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
100k
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
100k
    } else {
519
100k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
100k
        ss->id = operator_id();
521
100k
        for (auto& dest : dests_id()) {
522
100k
            ss->related_op_ids.insert(dest);
523
100k
        }
524
100k
        return ss;
525
100k
    }
526
100k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
64
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
64
    } else {
519
64
        auto ss = LocalStateType::SharedStateType::create_shared();
520
64
        ss->id = operator_id();
521
64
        for (auto& dest : dests_id()) {
522
63
            ss->related_op_ids.insert(dest);
523
63
        }
524
64
        return ss;
525
64
    }
526
64
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
536k
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
536k
    } else {
519
536k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
536k
        ss->id = operator_id();
521
536k
        for (auto& dest : dests_id()) {
522
533k
            ss->related_op_ids.insert(dest);
523
533k
        }
524
536k
        return ss;
525
536k
    }
526
536k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
5.90k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
5.90k
    } else {
519
5.90k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
5.90k
        ss->id = operator_id();
521
5.90k
        for (auto& dest : dests_id()) {
522
5.89k
            ss->related_op_ids.insert(dest);
523
5.89k
        }
524
5.90k
        return ss;
525
5.90k
    }
526
5.90k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
711
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
711
    } else {
519
711
        auto ss = LocalStateType::SharedStateType::create_shared();
520
711
        ss->id = operator_id();
521
711
        for (auto& dest : dests_id()) {
522
709
            ss->related_op_ids.insert(dest);
523
709
        }
524
711
        return ss;
525
711
    }
526
711
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.54k
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.54k
    } else {
519
2.54k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.54k
        ss->id = operator_id();
521
2.54k
        for (auto& dest : dests_id()) {
522
2.54k
            ss->related_op_ids.insert(dest);
523
2.54k
        }
524
2.54k
        return ss;
525
2.54k
    }
526
2.54k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.50k
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.50k
    } else {
519
2.50k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.50k
        ss->id = operator_id();
521
2.50k
        for (auto& dest : dests_id()) {
522
2.50k
            ss->related_op_ids.insert(dest);
523
2.50k
        }
524
2.50k
        return ss;
525
2.50k
    }
526
2.50k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
569
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
569
    } else {
519
569
        auto ss = LocalStateType::SharedStateType::create_shared();
520
569
        ss->id = operator_id();
521
569
        for (auto& dest : dests_id()) {
522
564
            ss->related_op_ids.insert(dest);
523
564
        }
524
569
        return ss;
525
569
    }
526
569
}
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
104
            ss->related_op_ids.insert(dest);
523
104
        }
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
2.04M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.04M
    auto local_state = LocalStateType::create_unique(state, this);
531
2.04M
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.04M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.04M
    return Status::OK();
534
2.04M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
69.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
69.2k
    auto local_state = LocalStateType::create_unique(state, this);
531
69.2k
    RETURN_IF_ERROR(local_state->init(state, info));
532
69.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
69.2k
    return Status::OK();
534
69.2k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
252k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
252k
    auto local_state = LocalStateType::create_unique(state, this);
531
252k
    RETURN_IF_ERROR(local_state->init(state, info));
532
252k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
252k
    return Status::OK();
534
252k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
122
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
122
    auto local_state = LocalStateType::create_unique(state, this);
531
122
    RETURN_IF_ERROR(local_state->init(state, info));
532
122
    state->emplace_local_state(operator_id(), std::move(local_state));
533
122
    return Status::OK();
534
122
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.24k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.24k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.24k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.24k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.24k
    return Status::OK();
534
3.24k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.0k
    return Status::OK();
534
10.0k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
9.05k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
9.05k
    auto local_state = LocalStateType::create_unique(state, this);
531
9.05k
    RETURN_IF_ERROR(local_state->init(state, info));
532
9.05k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
9.05k
    return Status::OK();
534
9.05k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
30
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
30
    auto local_state = LocalStateType::create_unique(state, this);
531
30
    RETURN_IF_ERROR(local_state->init(state, info));
532
30
    state->emplace_local_state(operator_id(), std::move(local_state));
533
30
    return Status::OK();
534
30
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_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_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
100k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
100k
    auto local_state = LocalStateType::create_unique(state, this);
531
100k
    RETURN_IF_ERROR(local_state->init(state, info));
532
100k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
100k
    return Status::OK();
534
100k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
58.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
58.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
58.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
58.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
58.8k
    return Status::OK();
534
58.8k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
54
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54
    auto local_state = LocalStateType::create_unique(state, this);
531
54
    RETURN_IF_ERROR(local_state->init(state, info));
532
54
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54
    return Status::OK();
534
54
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.87k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.87k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.87k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.87k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.87k
    return Status::OK();
534
3.87k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_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
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.12k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.12k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.12k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.12k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.12k
    return Status::OK();
534
1.12k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.89k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.89k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.89k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.89k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.89k
    return Status::OK();
534
5.89k
}
_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.55k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.55k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.55k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.55k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.55k
    return Status::OK();
534
1.55k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
56.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
56.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
56.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
56.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
56.0k
    return Status::OK();
534
56.0k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.32k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.32k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.32k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.32k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.32k
    return Status::OK();
534
5.32k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
597
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
597
    auto local_state = LocalStateType::create_unique(state, this);
531
597
    RETURN_IF_ERROR(local_state->init(state, info));
532
597
    state->emplace_local_state(operator_id(), std::move(local_state));
533
597
    return Status::OK();
534
597
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.55k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.55k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.55k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.55k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.55k
    return Status::OK();
534
2.55k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.52k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.52k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.52k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.52k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.52k
    return Status::OK();
534
2.52k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
497
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
497
    auto local_state = LocalStateType::create_unique(state, this);
531
497
    RETURN_IF_ERROR(local_state->init(state, info));
532
497
    state->emplace_local_state(operator_id(), std::move(local_state));
533
497
    return Status::OK();
534
497
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.69k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.69k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.69k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.69k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.69k
    return Status::OK();
534
1.69k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.7k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.7k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.7k
    return Status::OK();
534
10.7k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
644k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
644k
    auto local_state = LocalStateType::create_unique(state, this);
531
644k
    RETURN_IF_ERROR(local_state->init(state, info));
532
644k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
644k
    return Status::OK();
534
644k
}
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
804
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
804
    auto local_state = LocalStateType::create_unique(state, this);
531
804
    RETURN_IF_ERROR(local_state->init(state, info));
532
804
    state->emplace_local_state(operator_id(), std::move(local_state));
533
804
    return Status::OK();
534
804
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
983
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
983
    auto local_state = LocalStateType::create_unique(state, this);
531
983
    RETURN_IF_ERROR(local_state->init(state, info));
532
983
    state->emplace_local_state(operator_id(), std::move(local_state));
533
983
    return Status::OK();
534
983
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_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_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
277k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
277k
    auto local_state = LocalStateType::create_unique(state, this);
531
277k
    RETURN_IF_ERROR(local_state->init(state, info));
532
277k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
277k
    return Status::OK();
534
277k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.75M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
2.04M
        : _num_rows_returned(0),
542
2.04M
          _rows_returned_counter(nullptr),
543
2.04M
          _parent(parent),
544
2.04M
          _state(state),
545
2.04M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
2.05M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
2.05M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
2.05M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
2.05M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
2.05M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
2.05M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
2.05M
    _operator_profile->add_child(_common_profile.get(), true);
557
2.05M
    _operator_profile->add_child(_custom_profile.get(), true);
558
2.05M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
2.05M
    if constexpr (!is_fake_shared) {
560
1.20M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
713k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
713k
                                    .first.get()
563
713k
                                    ->template cast<SharedStateArg>();
564
565
713k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
713k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
713k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
713k
        } else if (info.shared_state) {
569
428k
            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
428k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
428k
            _dependency = _shared_state->create_source_dependency(
576
428k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
428k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
428k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
428k
        } else {
580
65.0k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
5.32k
                DCHECK(false);
582
5.32k
            }
583
65.0k
        }
584
1.20M
    }
585
586
2.05M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
2.05M
    _rows_returned_counter =
591
2.05M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
2.05M
    _blocks_returned_counter =
593
2.05M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
2.05M
    _output_block_bytes_counter =
595
2.05M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
2.05M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
2.05M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
2.05M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
2.05M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
2.05M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
2.05M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
2.05M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
2.05M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
2.05M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
2.05M
    _memory_used_counter =
606
2.05M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
2.05M
    _common_profile->add_info_string("IsColocate",
608
2.05M
                                     std::to_string(_parent->is_colocated_operator()));
609
2.05M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
2.05M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
2.05M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
2.05M
    return Status::OK();
613
2.05M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
69.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
69.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
69.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
69.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
69.3k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
69.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
69.3k
    _operator_profile->add_child(_common_profile.get(), true);
557
69.3k
    _operator_profile->add_child(_custom_profile.get(), true);
558
69.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
69.3k
    if constexpr (!is_fake_shared) {
560
69.3k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
12.7k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
12.7k
                                    .first.get()
563
12.7k
                                    ->template cast<SharedStateArg>();
564
565
12.7k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
12.7k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
12.7k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
56.5k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
55.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
55.8k
            _dependency = _shared_state->create_source_dependency(
576
55.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
55.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
55.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
55.8k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
622
        }
584
69.3k
    }
585
586
69.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
69.3k
    _rows_returned_counter =
591
69.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
69.3k
    _blocks_returned_counter =
593
69.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
69.3k
    _output_block_bytes_counter =
595
69.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
69.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
69.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
69.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
69.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
69.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
69.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
69.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
69.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
69.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
69.3k
    _memory_used_counter =
606
69.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
69.3k
    _common_profile->add_info_string("IsColocate",
608
69.3k
                                     std::to_string(_parent->is_colocated_operator()));
609
69.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
69.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
69.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
69.3k
    return Status::OK();
613
69.3k
}
_ZN5doris19PipelineXLocalStateINS_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
248k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
248k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
248k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
248k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
248k
    _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
248k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
248k
    _operator_profile->add_child(_common_profile.get(), true);
557
248k
    _operator_profile->add_child(_custom_profile.get(), true);
558
248k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
248k
    if constexpr (!is_fake_shared) {
560
248k
        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
248k
        } 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
242k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
242k
            _dependency = _shared_state->create_source_dependency(
576
242k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
242k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
242k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
242k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
5.88k
        }
584
248k
    }
585
586
248k
    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
248k
    _rows_returned_counter =
591
248k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
248k
    _blocks_returned_counter =
593
248k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
248k
    _output_block_bytes_counter =
595
248k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
248k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
248k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
248k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
248k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
248k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
248k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
248k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
248k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
248k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
248k
    _memory_used_counter =
606
248k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
248k
    _common_profile->add_info_string("IsColocate",
608
248k
                                     std::to_string(_parent->is_colocated_operator()));
609
248k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
248k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
248k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
248k
    return Status::OK();
613
248k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
30
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
30
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
30
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
30
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
30
    _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
30
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
30
    _operator_profile->add_child(_common_profile.get(), true);
557
30
    _operator_profile->add_child(_custom_profile.get(), true);
558
30
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
30
    if constexpr (!is_fake_shared) {
560
30
        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
30
        } 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
30
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
30
            _dependency = _shared_state->create_source_dependency(
576
30
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
30
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
30
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
30
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
30
    }
585
586
30
    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
30
    _rows_returned_counter =
591
30
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
30
    _blocks_returned_counter =
593
30
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
30
    _output_block_bytes_counter =
595
30
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
30
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
30
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
30
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
30
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
30
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
30
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
30
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
30
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
30
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
30
    _memory_used_counter =
606
30
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
30
    _common_profile->add_info_string("IsColocate",
608
30
                                     std::to_string(_parent->is_colocated_operator()));
609
30
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
30
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
30
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
30
    return Status::OK();
613
30
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.89k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.89k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.89k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.89k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.89k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.89k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.89k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.89k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.89k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.89k
    if constexpr (!is_fake_shared) {
560
5.89k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.89k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.84k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.84k
            _dependency = _shared_state->create_source_dependency(
576
5.84k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.84k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.84k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.84k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
55
        }
584
5.89k
    }
585
586
5.89k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.89k
    _rows_returned_counter =
591
5.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.89k
    _blocks_returned_counter =
593
5.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.89k
    _output_block_bytes_counter =
595
5.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.89k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.89k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.89k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.89k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.89k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.89k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.89k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.89k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.89k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.89k
    _memory_used_counter =
606
5.89k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.89k
    _common_profile->add_info_string("IsColocate",
608
5.89k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.89k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.89k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.89k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.89k
    return Status::OK();
613
5.89k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
10.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
10.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
10.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
10.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
10.0k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
10.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
10.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
10.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
10.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
10.0k
    if constexpr (!is_fake_shared) {
560
10.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
10.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
9.87k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
9.87k
            _dependency = _shared_state->create_source_dependency(
576
9.87k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
9.87k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
9.87k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
9.87k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
208
        }
584
10.0k
    }
585
586
10.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
10.0k
    _rows_returned_counter =
591
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
10.0k
    _blocks_returned_counter =
593
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
10.0k
    _output_block_bytes_counter =
595
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
10.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
10.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
10.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
10.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
10.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
10.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
10.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
10.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
10.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
10.0k
    _memory_used_counter =
606
10.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
10.0k
    _common_profile->add_info_string("IsColocate",
608
10.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
10.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
10.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
10.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
10.0k
    return Status::OK();
613
10.0k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
100k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
100k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
100k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
100k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
100k
    _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
100k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
100k
    _operator_profile->add_child(_common_profile.get(), true);
557
100k
    _operator_profile->add_child(_custom_profile.get(), true);
558
100k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
100k
    if constexpr (!is_fake_shared) {
560
100k
        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
100k
        } 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
99.2k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
99.2k
            _dependency = _shared_state->create_source_dependency(
576
99.2k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
99.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
99.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
99.2k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.34k
        }
584
100k
    }
585
586
100k
    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
100k
    _rows_returned_counter =
591
100k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
100k
    _blocks_returned_counter =
593
100k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
100k
    _output_block_bytes_counter =
595
100k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
100k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
100k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
100k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
100k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
100k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
100k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
100k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
100k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
100k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
100k
    _memory_used_counter =
606
100k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
100k
    _common_profile->add_info_string("IsColocate",
608
100k
                                     std::to_string(_parent->is_colocated_operator()));
609
100k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
100k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
100k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
100k
    return Status::OK();
613
100k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
58.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
58.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
58.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
58.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
58.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
58.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
58.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
58.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
58.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
58.8k
    if constexpr (!is_fake_shared) {
560
58.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
58.9k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
58.9k
                                    .first.get()
563
58.9k
                                    ->template cast<SharedStateArg>();
564
565
58.9k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
58.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
58.9k
                    _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
58.8k
    }
585
586
58.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
58.8k
    _rows_returned_counter =
591
58.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
58.8k
    _blocks_returned_counter =
593
58.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
58.8k
    _output_block_bytes_counter =
595
58.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
58.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
58.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
58.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
58.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
58.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
58.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
58.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
58.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
58.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
58.8k
    _memory_used_counter =
606
58.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
58.8k
    _common_profile->add_info_string("IsColocate",
608
58.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
58.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
58.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
58.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
58.8k
    return Status::OK();
613
58.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54
    _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
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54
    _operator_profile->add_child(_common_profile.get(), true);
557
54
    _operator_profile->add_child(_custom_profile.get(), true);
558
54
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54
    if constexpr (!is_fake_shared) {
560
54
        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
        } 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
54
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
54
            _dependency = _shared_state->create_source_dependency(
576
54
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
54
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
54
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
54
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
54
    }
585
586
55
    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
    _rows_returned_counter =
591
54
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54
    _blocks_returned_counter =
593
54
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54
    _output_block_bytes_counter =
595
54
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54
    _memory_used_counter =
606
54
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54
    _common_profile->add_info_string("IsColocate",
608
54
                                     std::to_string(_parent->is_colocated_operator()));
609
54
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54
    return Status::OK();
613
54
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
844k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
844k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
844k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
844k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
844k
    _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
844k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
844k
    _operator_profile->add_child(_common_profile.get(), true);
557
844k
    _operator_profile->add_child(_custom_profile.get(), true);
558
844k
    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
844k
    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
844k
    _rows_returned_counter =
591
844k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
844k
    _blocks_returned_counter =
593
844k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
844k
    _output_block_bytes_counter =
595
844k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
844k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
844k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
844k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
844k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
844k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
844k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
844k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
844k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
844k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
844k
    _memory_used_counter =
606
844k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
844k
    _common_profile->add_info_string("IsColocate",
608
844k
                                     std::to_string(_parent->is_colocated_operator()));
609
844k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
844k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
844k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
844k
    return Status::OK();
613
844k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
56.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
56.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
56.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
56.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
56.0k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
56.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
56.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
56.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
56.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
56.0k
    if constexpr (!is_fake_shared) {
560
56.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
56.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
4.44k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.44k
            _dependency = _shared_state->create_source_dependency(
576
4.44k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.44k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.44k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
51.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
51.5k
        }
584
56.0k
    }
585
586
56.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
56.0k
    _rows_returned_counter =
591
56.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
56.0k
    _blocks_returned_counter =
593
56.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
56.0k
    _output_block_bytes_counter =
595
56.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
56.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
56.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
56.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
56.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
56.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
56.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
56.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
56.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
56.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
56.0k
    _memory_used_counter =
606
56.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
56.0k
    _common_profile->add_info_string("IsColocate",
608
56.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
56.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
56.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
56.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
56.0k
    return Status::OK();
613
56.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.34k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.34k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.34k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.34k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.34k
    _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.34k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.34k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.34k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.34k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.34k
    if constexpr (!is_fake_shared) {
560
5.34k
        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.34k
        } 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.25k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.25k
            _dependency = _shared_state->create_source_dependency(
576
5.25k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.25k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.25k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.25k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
92
        }
584
5.34k
    }
585
586
5.34k
    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.34k
    _rows_returned_counter =
591
5.34k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.34k
    _blocks_returned_counter =
593
5.34k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.34k
    _output_block_bytes_counter =
595
5.34k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.34k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.34k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.34k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.34k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.34k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.34k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.34k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.34k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.34k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.34k
    _memory_used_counter =
606
5.34k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.34k
    _common_profile->add_info_string("IsColocate",
608
5.34k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.34k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.34k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.34k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.34k
    return Status::OK();
613
5.34k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
712
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
712
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
712
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
712
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
712
    _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
712
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
712
    _operator_profile->add_child(_common_profile.get(), true);
557
712
    _operator_profile->add_child(_custom_profile.get(), true);
558
712
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
712
    if constexpr (!is_fake_shared) {
560
712
        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
712
        } 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
703
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
703
            _dependency = _shared_state->create_source_dependency(
576
703
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
703
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
703
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
703
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
9
        }
584
712
    }
585
586
712
    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
712
    _rows_returned_counter =
591
712
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
712
    _blocks_returned_counter =
593
712
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
712
    _output_block_bytes_counter =
595
712
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
712
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
712
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
712
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
712
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
712
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
712
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
712
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
712
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
712
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
712
    _memory_used_counter =
606
712
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
712
    _common_profile->add_info_string("IsColocate",
608
712
                                     std::to_string(_parent->is_colocated_operator()));
609
712
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
712
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
712
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
712
    return Status::OK();
613
712
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.09k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.09k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.09k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.09k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.09k
    _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.09k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.09k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.09k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.09k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.09k
    if constexpr (!is_fake_shared) {
560
5.09k
        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.09k
        } 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.07k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.07k
            _dependency = _shared_state->create_source_dependency(
576
5.07k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.07k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.07k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.07k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
24
        }
584
5.09k
    }
585
586
5.09k
    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.09k
    _rows_returned_counter =
591
5.09k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.09k
    _blocks_returned_counter =
593
5.09k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.09k
    _output_block_bytes_counter =
595
5.09k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.09k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.09k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.09k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.09k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.09k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.09k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.09k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.09k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.09k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.09k
    _memory_used_counter =
606
5.09k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.09k
    _common_profile->add_info_string("IsColocate",
608
5.09k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.09k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.09k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.09k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.09k
    return Status::OK();
613
5.09k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
646k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
646k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
646k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
646k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
646k
    _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
646k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
646k
    _operator_profile->add_child(_common_profile.get(), true);
557
646k
    _operator_profile->add_child(_custom_profile.get(), true);
558
646k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
646k
    if constexpr (!is_fake_shared) {
560
646k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
641k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
641k
                                    .first.get()
563
641k
                                    ->template cast<SharedStateArg>();
564
565
641k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
641k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
641k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
641k
        } 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
5.32k
        } else {
580
5.32k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
5.32k
                DCHECK(false);
582
5.32k
            }
583
5.32k
        }
584
646k
    }
585
586
646k
    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
646k
    _rows_returned_counter =
591
646k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
646k
    _blocks_returned_counter =
593
646k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
646k
    _output_block_bytes_counter =
595
646k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
646k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
646k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
646k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
646k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
646k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
646k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
646k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
646k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
646k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
646k
    _memory_used_counter =
606
646k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
646k
    _common_profile->add_info_string("IsColocate",
608
646k
                                     std::to_string(_parent->is_colocated_operator()));
609
646k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
646k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
646k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
646k
    return Status::OK();
613
646k
}
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.05M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.05M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.36M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
310k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
310k
    }
621
2.05M
    if (_parent->has_projection()) {
622
392k
        const auto& projection = *_parent->_projection;
623
392k
        _projections.resize(projection.projections.size());
624
2.44M
        for (size_t i = 0; i < _projections.size(); i++) {
625
2.05M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
2.05M
        }
627
392k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
414k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
22.2k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
277k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
255k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
255k
                        state, _intermediate_projections[i][j]));
633
255k
            }
634
22.2k
        }
635
392k
    }
636
2.05M
    return Status::OK();
637
2.05M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
69.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
69.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
70.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.53k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.53k
    }
621
69.4k
    if (_parent->has_projection()) {
622
69.4k
        const auto& projection = *_parent->_projection;
623
69.4k
        _projections.resize(projection.projections.size());
624
382k
        for (size_t i = 0; i < _projections.size(); i++) {
625
313k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
313k
        }
627
69.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
78.8k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
9.34k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
200k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
190k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
190k
                        state, _intermediate_projections[i][j]));
633
190k
            }
634
9.34k
        }
635
69.4k
    }
636
69.4k
    return Status::OK();
637
69.4k
}
_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
248k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
248k
    _conjuncts.resize(_parent->_conjuncts.size());
618
248k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
248k
    if (_parent->has_projection()) {
622
83
        const auto& projection = *_parent->_projection;
623
83
        _projections.resize(projection.projections.size());
624
420
        for (size_t i = 0; i < _projections.size(); i++) {
625
337
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
337
        }
627
83
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
83
        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
83
    }
636
248k
    return Status::OK();
637
248k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
30
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
30
    _conjuncts.resize(_parent->_conjuncts.size());
618
30
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
30
    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
30
    return Status::OK();
637
30
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.90k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.90k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.94k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
38
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
38
    }
621
5.91k
    if (_parent->has_projection()) {
622
5.91k
        const auto& projection = *_parent->_projection;
623
5.91k
        _projections.resize(projection.projections.size());
624
27.7k
        for (size_t i = 0; i < _projections.size(); i++) {
625
21.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
21.8k
        }
627
5.91k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.93k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
20
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
177
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
157
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
157
                        state, _intermediate_projections[i][j]));
633
157
            }
634
20
        }
635
5.91k
    }
636
5.90k
    return Status::OK();
637
5.90k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
10.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
10.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
11.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.00k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.00k
    }
621
10.0k
    if (_parent->has_projection()) {
622
5.32k
        const auto& projection = *_parent->_projection;
623
5.32k
        _projections.resize(projection.projections.size());
624
22.2k
        for (size_t i = 0; i < _projections.size(); i++) {
625
16.9k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
16.9k
        }
627
5.32k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.40k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
85
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
639
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
554
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
554
                        state, _intermediate_projections[i][j]));
633
554
            }
634
85
        }
635
5.32k
    }
636
10.0k
    return Status::OK();
637
10.0k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
100k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
100k
    _conjuncts.resize(_parent->_conjuncts.size());
618
102k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.26k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.26k
    }
621
100k
    if (_parent->has_projection()) {
622
31.5k
        const auto& projection = *_parent->_projection;
623
31.5k
        _projections.resize(projection.projections.size());
624
288k
        for (size_t i = 0; i < _projections.size(); i++) {
625
256k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
256k
        }
627
31.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
32.2k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
772
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
4.99k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
4.22k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
4.22k
                        state, _intermediate_projections[i][j]));
633
4.22k
            }
634
772
        }
635
31.5k
    }
636
100k
    return Status::OK();
637
100k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
58.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
58.9k
    _conjuncts.resize(_parent->_conjuncts.size());
618
58.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
21
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
21
    }
621
58.9k
    if (_parent->has_projection()) {
622
315
        const auto& projection = *_parent->_projection;
623
315
        _projections.resize(projection.projections.size());
624
1.39k
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.08k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.08k
        }
627
315
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
315
        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
315
    }
636
58.9k
    return Status::OK();
637
58.9k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
59
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
59
    _conjuncts.resize(_parent->_conjuncts.size());
618
59
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
59
    if (_parent->has_projection()) {
622
21
        const auto& projection = *_parent->_projection;
623
21
        _projections.resize(projection.projections.size());
624
63
        for (size_t i = 0; i < _projections.size(); i++) {
625
42
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
42
        }
627
21
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
21
        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
21
    }
636
59
    return Status::OK();
637
59
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
848k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
848k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.15M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
305k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
305k
    }
621
848k
    if (_parent->has_projection()) {
622
267k
        const auto& projection = *_parent->_projection;
623
267k
        _projections.resize(projection.projections.size());
624
1.60M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.33M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.33M
        }
627
267k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
279k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
11.8k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
68.5k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
56.6k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
56.6k
                        state, _intermediate_projections[i][j]));
633
56.6k
            }
634
11.8k
        }
635
267k
    }
636
848k
    return Status::OK();
637
848k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
56.1k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
56.1k
    _conjuncts.resize(_parent->_conjuncts.size());
618
56.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
56.1k
    if (_parent->has_projection()) {
622
11.8k
        const auto& projection = *_parent->_projection;
623
11.8k
        _projections.resize(projection.projections.size());
624
113k
        for (size_t i = 0; i < _projections.size(); i++) {
625
101k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
101k
        }
627
11.8k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.9k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
131
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
2.79k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
2.66k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
2.66k
                        state, _intermediate_projections[i][j]));
633
2.66k
            }
634
131
        }
635
11.8k
    }
636
56.1k
    return Status::OK();
637
56.1k
}
_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.33k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.33k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.87k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
539
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
539
    }
621
5.33k
    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.33k
    return Status::OK();
637
5.33k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
714
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
714
    _conjuncts.resize(_parent->_conjuncts.size());
618
714
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
714
    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
714
    return Status::OK();
637
714
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.09k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.09k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.09k
    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.09k
    if (_parent->has_projection()) {
622
63
        const auto& projection = *_parent->_projection;
623
63
        _projections.resize(projection.projections.size());
624
237
        for (size_t i = 0; i < _projections.size(); i++) {
625
174
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
174
        }
627
63
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
63
        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
63
    }
636
5.09k
    return Status::OK();
637
5.09k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
648k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
648k
    _conjuncts.resize(_parent->_conjuncts.size());
618
648k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
648k
    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
648k
    return Status::OK();
637
648k
}
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
7.86k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
7.86k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
7.86k
    _terminated = true;
645
7.86k
    return Status::OK();
646
7.86k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
460
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
460
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
460
    _terminated = true;
645
460
    return Status::OK();
646
460
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
65
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
65
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
65
    _terminated = true;
645
65
    return Status::OK();
646
65
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
50
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
50
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
50
    _terminated = true;
645
50
    return Status::OK();
646
50
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
4
    _terminated = true;
645
4
    return Status::OK();
646
4
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
58
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
58
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
58
    _terminated = true;
645
58
    return Status::OK();
646
58
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
6.24k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.24k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.24k
    _terminated = true;
645
6.24k
    return Status::OK();
646
6.24k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
55
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
55
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
55
    _terminated = true;
645
55
    return Status::OK();
646
55
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
9
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
9
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
9
    _terminated = true;
645
9
    return Status::OK();
646
9
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_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_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
35
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
35
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
35
    _terminated = true;
645
35
    return Status::OK();
646
35
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
844
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
844
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
844
    _terminated = true;
645
844
    return Status::OK();
646
844
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
40
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
40
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
40
    _terminated = true;
645
40
    return Status::OK();
646
40
}
647
648
template <typename SharedStateArg>
649
2.33M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.33M
    if (_closed) {
651
278k
        return Status::OK();
652
278k
    }
653
2.05M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.20M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.20M
    }
656
2.05M
    _closed = true;
657
2.05M
    return Status::OK();
658
2.33M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
69.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
69.3k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
69.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
69.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
69.3k
    }
656
69.3k
    _closed = true;
657
69.3k
    return Status::OK();
658
69.3k
}
_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
492k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
492k
    if (_closed) {
651
247k
        return Status::OK();
652
247k
    }
653
245k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
245k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
245k
    }
656
245k
    _closed = true;
657
245k
    return Status::OK();
658
492k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
30
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
30
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
30
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
30
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
30
    }
656
30
    _closed = true;
657
30
    return Status::OK();
658
30
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.89k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.89k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.89k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.89k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.89k
    }
656
5.89k
    _closed = true;
657
5.89k
    return Status::OK();
658
5.89k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
20.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
20.3k
    if (_closed) {
651
10.2k
        return Status::OK();
652
10.2k
    }
653
10.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
10.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
10.0k
    }
656
10.0k
    _closed = true;
657
10.0k
    return Status::OK();
658
20.3k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
100k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
100k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
100k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
100k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
100k
    }
656
100k
    _closed = true;
657
100k
    return Status::OK();
658
100k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
58.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
58.7k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
58.7k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
58.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
58.7k
    }
656
58.7k
    _closed = true;
657
58.7k
    return Status::OK();
658
58.7k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54
    }
656
54
    _closed = true;
657
54
    return Status::OK();
658
54
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
863k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
863k
    if (_closed) {
651
14.5k
        return Status::OK();
652
14.5k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
849k
    _closed = true;
657
849k
    return Status::OK();
658
863k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
56.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
56.1k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
56.1k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
56.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
56.1k
    }
656
56.1k
    _closed = true;
657
56.1k
    return Status::OK();
658
56.1k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.31k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.31k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.31k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.31k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.31k
    }
656
5.31k
    _closed = true;
657
5.31k
    return Status::OK();
658
5.31k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
1.22k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
1.22k
    if (_closed) {
651
613
        return Status::OK();
652
613
    }
653
610
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
610
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
610
    }
656
610
    _closed = true;
657
610
    return Status::OK();
658
1.22k
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.4k
    if (_closed) {
651
5.37k
        return Status::OK();
652
5.37k
    }
653
5.08k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.08k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.08k
    }
656
5.08k
    _closed = true;
657
5.08k
    return Status::OK();
658
10.4k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
649k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
649k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
649k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
649k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
649k
    }
656
649k
    _closed = true;
657
649k
    return Status::OK();
658
649k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
333
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
333
    if (_closed) {
651
173
        return Status::OK();
652
173
    }
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
333
}
659
660
template <typename SharedState>
661
1.75M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.75M
    _operator_profile =
664
1.75M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.75M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.75M
    _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.75M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.75M
    _operator_profile->add_child(_common_profile, true);
673
1.75M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.75M
    _operator_profile->set_metadata(_parent->node_id());
676
1.75M
    _wait_for_finish_dependency_timer =
677
1.75M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.75M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.75M
    if constexpr (!is_fake_shared) {
680
1.21M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.21M
            info.shared_state_map.end()) {
682
315k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
243k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
243k
            }
685
315k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
315k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
315k
                                                  ? 0
688
315k
                                                  : info.task_idx]
689
315k
                                  .get();
690
315k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
904k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
904k
            _shared_state = info.shared_state->template cast<SharedState>();
696
904k
            _dependency = _shared_state->create_sink_dependency(
697
904k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
904k
        }
699
1.21M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.21M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.21M
    }
702
703
1.75M
    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.75M
    _rows_input_counter =
708
1.75M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.75M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.75M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.75M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.75M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.75M
    _memory_used_counter =
714
1.75M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.75M
    _common_profile->add_info_string("IsColocate",
716
1.75M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.75M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.75M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.75M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.75M
    return Status::OK();
721
1.75M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
117k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
117k
    _operator_profile =
664
117k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
117k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
117k
    _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
117k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
117k
    _operator_profile->add_child(_common_profile, true);
673
117k
    _operator_profile->add_child(_custom_profile, true);
674
675
117k
    _operator_profile->set_metadata(_parent->node_id());
676
117k
    _wait_for_finish_dependency_timer =
677
117k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
117k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
117k
    if constexpr (!is_fake_shared) {
680
117k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
117k
            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
12.9k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
12.9k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
12.9k
                                                  ? 0
688
12.9k
                                                  : info.task_idx]
689
12.9k
                                  .get();
690
12.9k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
104k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
104k
            _shared_state = info.shared_state->template cast<SharedState>();
696
104k
            _dependency = _shared_state->create_sink_dependency(
697
104k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
104k
        }
699
117k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
117k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
117k
    }
702
703
117k
    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
117k
    _rows_input_counter =
708
117k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
117k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
117k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
117k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
117k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
117k
    _memory_used_counter =
714
117k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
117k
    _common_profile->add_info_string("IsColocate",
716
117k
                                     std::to_string(_parent->is_colocated_operator()));
717
117k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
117k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
117k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
117k
    return Status::OK();
721
117k
}
_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
248k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
248k
    _operator_profile =
664
248k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
248k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
248k
    _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
248k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
248k
    _operator_profile->add_child(_common_profile, true);
673
248k
    _operator_profile->add_child(_custom_profile, true);
674
675
248k
    _operator_profile->set_metadata(_parent->node_id());
676
248k
    _wait_for_finish_dependency_timer =
677
248k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
248k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
248k
    if constexpr (!is_fake_shared) {
680
248k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
248k
            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
248k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
248k
            _shared_state = info.shared_state->template cast<SharedState>();
696
248k
            _dependency = _shared_state->create_sink_dependency(
697
248k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
248k
        }
699
248k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
248k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
248k
    }
702
703
248k
    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
248k
    _rows_input_counter =
708
248k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
248k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
248k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
248k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
248k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
248k
    _memory_used_counter =
714
248k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
248k
    _common_profile->add_info_string("IsColocate",
716
248k
                                     std::to_string(_parent->is_colocated_operator()));
717
248k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
248k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
248k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
248k
    return Status::OK();
721
248k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
37
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
37
    _operator_profile =
664
37
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
37
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
37
    _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
37
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
37
    _operator_profile->add_child(_common_profile, true);
673
37
    _operator_profile->add_child(_custom_profile, true);
674
675
37
    _operator_profile->set_metadata(_parent->node_id());
676
37
    _wait_for_finish_dependency_timer =
677
37
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
37
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
37
    if constexpr (!is_fake_shared) {
680
37
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
37
            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
37
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
37
            _shared_state = info.shared_state->template cast<SharedState>();
696
37
            _dependency = _shared_state->create_sink_dependency(
697
37
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
37
        }
699
37
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
37
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
37
    }
702
703
37
    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
37
    _rows_input_counter =
708
37
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
37
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
37
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
37
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
37
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
37
    _memory_used_counter =
714
37
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
37
    _common_profile->add_info_string("IsColocate",
716
37
                                     std::to_string(_parent->is_colocated_operator()));
717
37
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
37
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
37
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
37
    return Status::OK();
721
37
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.90k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.90k
    _operator_profile =
664
5.90k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.90k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.90k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
5.90k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.90k
    _operator_profile->add_child(_common_profile, true);
673
5.90k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.90k
    _operator_profile->set_metadata(_parent->node_id());
676
5.90k
    _wait_for_finish_dependency_timer =
677
5.90k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.90k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.90k
    if constexpr (!is_fake_shared) {
680
5.90k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.90k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
5.90k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.90k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.90k
            _dependency = _shared_state->create_sink_dependency(
697
5.90k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.90k
        }
699
5.90k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.90k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.90k
    }
702
703
5.90k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
5.90k
    _rows_input_counter =
708
5.90k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.90k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.90k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.90k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.90k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.90k
    _memory_used_counter =
714
5.90k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.90k
    _common_profile->add_info_string("IsColocate",
716
5.90k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.90k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.90k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.90k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.90k
    return Status::OK();
721
5.90k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
10.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
10.0k
    _operator_profile =
664
10.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
10.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
10.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
10.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
10.0k
    _operator_profile->add_child(_common_profile, true);
673
10.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
10.0k
    _operator_profile->set_metadata(_parent->node_id());
676
10.0k
    _wait_for_finish_dependency_timer =
677
10.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
10.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
10.0k
    if constexpr (!is_fake_shared) {
680
10.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
10.0k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
10.0k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
10.0k
            _shared_state = info.shared_state->template cast<SharedState>();
696
10.0k
            _dependency = _shared_state->create_sink_dependency(
697
10.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
10.0k
        }
699
10.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
10.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
10.0k
    }
702
703
10.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
10.0k
    _rows_input_counter =
708
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
10.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
10.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
10.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
10.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
10.0k
    _memory_used_counter =
714
10.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
10.0k
    _common_profile->add_info_string("IsColocate",
716
10.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
10.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
10.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
10.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
10.0k
    return Status::OK();
721
10.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
100k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
100k
    _operator_profile =
664
100k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
100k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
100k
    _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
100k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
100k
    _operator_profile->add_child(_common_profile, true);
673
100k
    _operator_profile->add_child(_custom_profile, true);
674
675
100k
    _operator_profile->set_metadata(_parent->node_id());
676
100k
    _wait_for_finish_dependency_timer =
677
100k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
100k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
100k
    if constexpr (!is_fake_shared) {
680
100k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
100k
            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
100k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
100k
            _shared_state = info.shared_state->template cast<SharedState>();
696
100k
            _dependency = _shared_state->create_sink_dependency(
697
100k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
100k
        }
699
100k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
100k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
100k
    }
702
703
100k
    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
100k
    _rows_input_counter =
708
100k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
100k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
100k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
100k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
100k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
100k
    _memory_used_counter =
714
100k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
100k
    _common_profile->add_info_string("IsColocate",
716
100k
                                     std::to_string(_parent->is_colocated_operator()));
717
100k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
100k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
100k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
100k
    return Status::OK();
721
100k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
58.9k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
58.9k
    _operator_profile =
664
58.9k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
58.9k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
58.9k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
58.9k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
58.9k
    _operator_profile->add_child(_common_profile, true);
673
58.9k
    _operator_profile->add_child(_custom_profile, true);
674
675
58.9k
    _operator_profile->set_metadata(_parent->node_id());
676
58.9k
    _wait_for_finish_dependency_timer =
677
58.9k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
58.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
58.9k
    if constexpr (!is_fake_shared) {
680
58.9k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
58.9k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
58.9k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
58.9k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
58.9k
                                                  ? 0
688
58.9k
                                                  : info.task_idx]
689
58.9k
                                  .get();
690
58.9k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
58.9k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
58.9k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
58.9k
    }
702
703
58.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
58.9k
    _rows_input_counter =
708
58.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
58.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
58.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
58.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
58.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
58.9k
    _memory_used_counter =
714
58.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
58.9k
    _common_profile->add_info_string("IsColocate",
716
58.9k
                                     std::to_string(_parent->is_colocated_operator()));
717
58.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
58.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
58.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
58.9k
    return Status::OK();
721
58.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
65
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
65
    _operator_profile =
664
65
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
65
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
65
    _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
65
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
65
    _operator_profile->add_child(_common_profile, true);
673
65
    _operator_profile->add_child(_custom_profile, true);
674
675
65
    _operator_profile->set_metadata(_parent->node_id());
676
65
    _wait_for_finish_dependency_timer =
677
65
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
65
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
65
    if constexpr (!is_fake_shared) {
680
65
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
65
            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
65
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
65
            _shared_state = info.shared_state->template cast<SharedState>();
696
65
            _dependency = _shared_state->create_sink_dependency(
697
65
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
65
        }
699
65
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
65
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
65
    }
702
703
65
    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
65
    _rows_input_counter =
708
65
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
65
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
65
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
65
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
65
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
65
    _memory_used_counter =
714
65
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
65
    _common_profile->add_info_string("IsColocate",
716
65
                                     std::to_string(_parent->is_colocated_operator()));
717
65
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
65
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
65
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
65
    return Status::OK();
721
65
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
538k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
538k
    _operator_profile =
664
538k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
538k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
538k
    _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
538k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
538k
    _operator_profile->add_child(_common_profile, true);
673
538k
    _operator_profile->add_child(_custom_profile, true);
674
675
538k
    _operator_profile->set_metadata(_parent->node_id());
676
538k
    _wait_for_finish_dependency_timer =
677
538k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
538k
    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
538k
    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
538k
    _rows_input_counter =
708
538k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
538k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
538k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
538k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
538k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
538k
    _memory_used_counter =
714
538k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
538k
    _common_profile->add_info_string("IsColocate",
716
538k
                                     std::to_string(_parent->is_colocated_operator()));
717
538k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
538k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
538k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
538k
    return Status::OK();
721
538k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
11.1k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
11.1k
    _operator_profile =
664
11.1k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
11.1k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
11.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
11.1k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
11.1k
    _operator_profile->add_child(_common_profile, true);
673
11.1k
    _operator_profile->add_child(_custom_profile, true);
674
675
11.1k
    _operator_profile->set_metadata(_parent->node_id());
676
11.1k
    _wait_for_finish_dependency_timer =
677
11.1k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
11.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
11.1k
    if constexpr (!is_fake_shared) {
680
11.1k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
11.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
11.1k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
11.1k
            _shared_state = info.shared_state->template cast<SharedState>();
696
11.1k
            _dependency = _shared_state->create_sink_dependency(
697
11.1k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
11.1k
        }
699
11.1k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
11.1k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
11.1k
    }
702
703
11.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
11.1k
    _rows_input_counter =
708
11.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
11.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
11.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
11.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
11.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
11.1k
    _memory_used_counter =
714
11.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
11.1k
    _common_profile->add_info_string("IsColocate",
716
11.1k
                                     std::to_string(_parent->is_colocated_operator()));
717
11.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
11.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
11.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
11.1k
    return Status::OK();
721
11.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
712
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
712
    _operator_profile =
664
712
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
712
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
712
    _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
712
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
712
    _operator_profile->add_child(_common_profile, true);
673
712
    _operator_profile->add_child(_custom_profile, true);
674
675
712
    _operator_profile->set_metadata(_parent->node_id());
676
712
    _wait_for_finish_dependency_timer =
677
712
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
712
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
712
    if constexpr (!is_fake_shared) {
680
712
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
712
            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
712
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
712
            _shared_state = info.shared_state->template cast<SharedState>();
696
712
            _dependency = _shared_state->create_sink_dependency(
697
712
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
712
        }
699
712
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
712
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
712
    }
702
703
712
    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
712
    _rows_input_counter =
708
712
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
712
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
712
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
712
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
712
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
712
    _memory_used_counter =
714
712
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
712
    _common_profile->add_info_string("IsColocate",
716
712
                                     std::to_string(_parent->is_colocated_operator()));
717
712
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
712
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
712
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
712
    return Status::OK();
721
712
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.06k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.06k
    _operator_profile =
664
2.06k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.06k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.06k
    _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.06k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.06k
    _operator_profile->add_child(_common_profile, true);
673
2.06k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.06k
    _operator_profile->set_metadata(_parent->node_id());
676
2.06k
    _wait_for_finish_dependency_timer =
677
2.06k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.06k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.06k
    if constexpr (!is_fake_shared) {
680
2.06k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.06k
            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.06k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.06k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.06k
            _dependency = _shared_state->create_sink_dependency(
697
2.06k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.06k
        }
699
2.06k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.06k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.06k
    }
702
703
2.06k
    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.06k
    _rows_input_counter =
708
2.06k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.06k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.06k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.06k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.06k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.06k
    _memory_used_counter =
714
2.06k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.06k
    _common_profile->add_info_string("IsColocate",
716
2.06k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.06k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.06k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.06k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.06k
    return Status::OK();
721
2.06k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.3k
    _operator_profile =
664
12.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.3k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.3k
    _operator_profile->add_child(_common_profile, true);
673
12.3k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.3k
    _operator_profile->set_metadata(_parent->node_id());
676
12.3k
    _wait_for_finish_dependency_timer =
677
12.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.3k
    if constexpr (!is_fake_shared) {
680
12.3k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.3k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
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.3k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.3k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.3k
            _dependency = _shared_state->create_sink_dependency(
697
12.3k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.3k
        }
699
12.3k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.3k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.3k
    }
702
703
12.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.3k
    _rows_input_counter =
708
12.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.3k
    _memory_used_counter =
714
12.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.3k
    _common_profile->add_info_string("IsColocate",
716
12.3k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.3k
    return Status::OK();
721
12.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
243k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
243k
    _operator_profile =
664
243k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
243k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
243k
    _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
243k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
243k
    _operator_profile->add_child(_common_profile, true);
673
243k
    _operator_profile->add_child(_custom_profile, true);
674
675
243k
    _operator_profile->set_metadata(_parent->node_id());
676
243k
    _wait_for_finish_dependency_timer =
677
243k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
243k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
243k
    if constexpr (!is_fake_shared) {
680
243k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
243k
            info.shared_state_map.end()) {
682
243k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
243k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
243k
            }
685
243k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
243k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
243k
                                                  ? 0
688
243k
                                                  : info.task_idx]
689
243k
                                  .get();
690
243k
            _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
243k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
243k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
243k
    }
702
703
243k
    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
243k
    _rows_input_counter =
708
243k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
243k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
243k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
243k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
243k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
243k
    _memory_used_counter =
714
243k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
243k
    _common_profile->add_info_string("IsColocate",
716
243k
                                     std::to_string(_parent->is_colocated_operator()));
717
243k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
243k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
243k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
243k
    return Status::OK();
721
243k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
407k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
407k
    _operator_profile =
664
407k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
407k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
407k
    _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
407k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
407k
    _operator_profile->add_child(_common_profile, true);
673
407k
    _operator_profile->add_child(_custom_profile, true);
674
675
407k
    _operator_profile->set_metadata(_parent->node_id());
676
407k
    _wait_for_finish_dependency_timer =
677
407k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
407k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
407k
    if constexpr (!is_fake_shared) {
680
407k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
407k
            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
407k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
407k
            _shared_state = info.shared_state->template cast<SharedState>();
696
407k
            _dependency = _shared_state->create_sink_dependency(
697
407k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
407k
        }
699
407k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
407k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
407k
    }
702
703
407k
    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
407k
    _rows_input_counter =
708
407k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
407k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
407k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
407k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
407k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
407k
    _memory_used_counter =
714
407k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
407k
    _common_profile->add_info_string("IsColocate",
716
407k
                                     std::to_string(_parent->is_colocated_operator()));
717
407k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
407k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
407k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
407k
    return Status::OK();
721
407k
}
_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.75M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.75M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.75M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.21M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.21M
    }
731
1.75M
    _closed = true;
732
1.75M
    return Status::OK();
733
1.75M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
117k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
117k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
117k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
117k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
117k
    }
731
117k
    _closed = true;
732
117k
    return Status::OK();
733
117k
}
_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
247k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
247k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
247k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
247k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
247k
    }
731
247k
    _closed = true;
732
247k
    return Status::OK();
733
247k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
28
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
28
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
26
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
26
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
26
    }
731
26
    _closed = true;
732
26
    return Status::OK();
733
28
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.87k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.87k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.87k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.87k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.87k
    }
731
5.87k
    _closed = true;
732
5.87k
    return Status::OK();
733
5.87k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
10.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
10.0k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
10.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
10.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
10.0k
    }
731
10.0k
    _closed = true;
732
10.0k
    return Status::OK();
733
10.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
100k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
100k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
100k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
100k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
100k
    }
731
100k
    _closed = true;
732
100k
    return Status::OK();
733
100k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
58.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
58.7k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
58.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
58.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
58.7k
    }
731
58.7k
    _closed = true;
732
58.7k
    return Status::OK();
733
58.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
54
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
54
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
54
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
54
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
54
    }
731
54
    _closed = true;
732
54
    return Status::OK();
733
54
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
538k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
538k
    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
538k
    _closed = true;
732
538k
    return Status::OK();
733
538k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
11.1k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
11.1k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
11.1k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
11.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
11.1k
    }
731
11.1k
    _closed = true;
732
11.1k
    return Status::OK();
733
11.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
612
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
612
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
612
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
612
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
612
    }
731
612
    _closed = true;
732
612
    return Status::OK();
733
612
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.09k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.09k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.09k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.09k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.09k
    }
731
2.09k
    _closed = true;
732
2.09k
    return Status::OK();
733
2.09k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.3k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.3k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.3k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.3k
    }
731
12.3k
    _closed = true;
732
12.3k
    return Status::OK();
733
12.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
243k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
243k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
243k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
243k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
243k
    }
731
243k
    _closed = true;
732
243k
    return Status::OK();
733
243k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
408k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
408k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
408k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
408k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
408k
    }
731
408k
    _closed = true;
732
408k
    return Status::OK();
733
408k
}
_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
4.24k
                                                          bool* eos) {
738
4.24k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.24k
    return pull(state, block, eos);
740
4.24k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
35
                                                          bool* eos) {
738
35
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
35
    return pull(state, block, eos);
740
35
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.21k
                                                          bool* eos) {
738
4.21k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.20k
    return pull(state, block, eos);
740
4.21k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
498k
                                                         bool* eos) {
745
498k
    auto& local_state = get_local_state(state);
746
498k
    if (need_more_input_data(state)) {
747
467k
        local_state._child_block->clear_column_data(
748
467k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
467k
                        .num_slots());
750
467k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
467k
                state, local_state._child_block.get(), &local_state._child_eos));
752
467k
        *eos = local_state._child_eos;
753
467k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
53.5k
            return Status::OK();
755
53.5k
        }
756
413k
        {
757
413k
            SCOPED_TIMER(local_state.exec_time_counter());
758
413k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
413k
        }
760
413k
    }
761
762
445k
    if (!need_more_input_data(state)) {
763
416k
        SCOPED_TIMER(local_state.exec_time_counter());
764
416k
        bool new_eos = false;
765
416k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
416k
        if (new_eos) {
767
342k
            *eos = true;
768
342k
        } else if (!need_more_input_data(state)) {
769
24.2k
            *eos = false;
770
24.2k
        }
771
416k
    }
772
445k
    return Status::OK();
773
445k
}
_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
111k
        local_state._child_block->clear_column_data(
748
111k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
111k
                        .num_slots());
750
111k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
111k
                state, local_state._child_block.get(), &local_state._child_eos));
752
111k
        *eos = local_state._child_eos;
753
111k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
30.2k
            return Status::OK();
755
30.2k
        }
756
80.8k
        {
757
80.8k
            SCOPED_TIMER(local_state.exec_time_counter());
758
80.8k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
80.8k
        }
760
80.8k
    }
761
762
100k
    if (!need_more_input_data(state)) {
763
100k
        SCOPED_TIMER(local_state.exec_time_counter());
764
100k
        bool new_eos = false;
765
100k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
100k
        if (new_eos) {
767
45.0k
            *eos = true;
768
55.2k
        } else if (!need_more_input_data(state)) {
769
11.6k
            *eos = false;
770
11.6k
        }
771
100k
    }
772
100k
    return Status::OK();
773
100k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.04k
                                                         bool* eos) {
745
4.04k
    auto& local_state = get_local_state(state);
746
4.04k
    if (need_more_input_data(state)) {
747
2.23k
        local_state._child_block->clear_column_data(
748
2.23k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.23k
                        .num_slots());
750
2.23k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.23k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.23k
        *eos = local_state._child_eos;
753
2.23k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
572
            return Status::OK();
755
572
        }
756
1.66k
        {
757
1.66k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.66k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.66k
        }
760
1.66k
    }
761
762
3.48k
    if (!need_more_input_data(state)) {
763
3.48k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.48k
        bool new_eos = false;
765
3.48k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.48k
        if (new_eos) {
767
1.12k
            *eos = true;
768
2.36k
        } else if (!need_more_input_data(state)) {
769
1.81k
            *eos = false;
770
1.81k
        }
771
3.48k
    }
772
3.46k
    return Status::OK();
773
3.46k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.90k
                                                         bool* eos) {
745
1.90k
    auto& local_state = get_local_state(state);
746
1.90k
    if (need_more_input_data(state)) {
747
1.90k
        local_state._child_block->clear_column_data(
748
1.90k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.90k
                        .num_slots());
750
1.90k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.90k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.90k
        *eos = local_state._child_eos;
753
1.90k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
785
            return Status::OK();
755
785
        }
756
1.12k
        {
757
1.12k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.12k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.12k
        }
760
1.12k
    }
761
762
1.12k
    if (!need_more_input_data(state)) {
763
1.12k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.12k
        bool new_eos = false;
765
1.12k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.12k
        if (new_eos) {
767
804
            *eos = true;
768
804
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.12k
    }
772
1.12k
    return Status::OK();
773
1.12k
}
_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.5k
    if (need_more_input_data(state)) {
747
16.5k
        local_state._child_block->clear_column_data(
748
16.5k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
16.5k
                        .num_slots());
750
16.5k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
16.5k
                state, local_state._child_block.get(), &local_state._child_eos));
752
16.5k
        *eos = local_state._child_eos;
753
16.5k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
2.91k
            return Status::OK();
755
2.91k
        }
756
13.6k
        {
757
13.6k
            SCOPED_TIMER(local_state.exec_time_counter());
758
13.6k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
13.6k
        }
760
13.6k
    }
761
762
13.6k
    if (!need_more_input_data(state)) {
763
7.66k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.66k
        bool new_eos = false;
765
7.66k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.66k
        if (new_eos) {
767
7.54k
            *eos = true;
768
7.54k
        } else if (!need_more_input_data(state)) {
769
10
            *eos = false;
770
10
        }
771
7.66k
    }
772
13.6k
    return Status::OK();
773
13.6k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
318k
                                                         bool* eos) {
745
318k
    auto& local_state = get_local_state(state);
746
319k
    if (need_more_input_data(state)) {
747
319k
        local_state._child_block->clear_column_data(
748
319k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
319k
                        .num_slots());
750
319k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
319k
                state, local_state._child_block.get(), &local_state._child_eos));
752
319k
        *eos = local_state._child_eos;
753
319k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
17.8k
            return Status::OK();
755
17.8k
        }
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
278k
        SCOPED_TIMER(local_state.exec_time_counter());
764
278k
        bool new_eos = false;
765
278k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
278k
        if (new_eos) {
767
277k
            *eos = true;
768
277k
        } else if (!need_more_input_data(state)) {
769
7
            *eos = false;
770
7
        }
771
278k
    }
772
300k
    return Status::OK();
773
300k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
20.5k
                                                         bool* eos) {
745
20.5k
    auto& local_state = get_local_state(state);
746
20.5k
    if (need_more_input_data(state)) {
747
10.1k
        local_state._child_block->clear_column_data(
748
10.1k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.1k
                        .num_slots());
750
10.1k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.1k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.1k
        *eos = local_state._child_eos;
753
10.1k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
509
            return Status::OK();
755
509
        }
756
9.68k
        {
757
9.68k
            SCOPED_TIMER(local_state.exec_time_counter());
758
9.68k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
9.68k
        }
760
9.68k
    }
761
762
20.0k
    if (!need_more_input_data(state)) {
763
19.5k
        SCOPED_TIMER(local_state.exec_time_counter());
764
19.5k
        bool new_eos = false;
765
19.5k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
19.5k
        if (new_eos) {
767
5.88k
            *eos = true;
768
13.7k
        } else if (!need_more_input_data(state)) {
769
10.3k
            *eos = false;
770
10.3k
        }
771
19.5k
    }
772
20.0k
    return Status::OK();
773
20.0k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
6.68k
                                                         bool* eos) {
745
6.68k
    auto& local_state = get_local_state(state);
746
6.68k
    if (need_more_input_data(state)) {
747
6.32k
        local_state._child_block->clear_column_data(
748
6.32k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.32k
                        .num_slots());
750
6.32k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.32k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.32k
        *eos = local_state._child_eos;
753
6.32k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
704
            return Status::OK();
755
704
        }
756
5.61k
        {
757
5.61k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.61k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.61k
        }
760
5.61k
    }
761
762
5.98k
    if (!need_more_input_data(state)) {
763
5.98k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.98k
        bool new_eos = false;
765
5.98k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.98k
        if (new_eos) {
767
3.84k
            *eos = true;
768
3.84k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
5.98k
    }
772
5.97k
    return Status::OK();
773
5.97k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
47.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.6k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.6k
                                                         "AsyncWriterDependency", true);
781
47.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.6k
                             _finish_dependency));
783
784
47.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.6k
    return Status::OK();
787
47.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
363
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
363
    RETURN_IF_ERROR(Base::init(state, info));
779
363
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
363
                                                         "AsyncWriterDependency", true);
781
363
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
363
                             _finish_dependency));
783
784
363
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
363
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
363
    return Status::OK();
787
363
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
47.2k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.2k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.2k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.2k
                                                         "AsyncWriterDependency", true);
781
47.2k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.2k
                             _finish_dependency));
783
784
47.2k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.2k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.2k
    return Status::OK();
787
47.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
8
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
8
    RETURN_IF_ERROR(Base::init(state, info));
779
8
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
8
                                                         "AsyncWriterDependency", true);
781
8
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
8
                             _finish_dependency));
783
784
8
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
8
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
8
    return Status::OK();
787
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
48.1k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
48.1k
    RETURN_IF_ERROR(Base::open(state));
793
48.1k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
370k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
322k
        RETURN_IF_ERROR(
796
322k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
322k
    }
798
48.1k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
48.1k
    return Status::OK();
800
48.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
364
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
364
    RETURN_IF_ERROR(Base::open(state));
793
364
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.87k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.51k
        RETURN_IF_ERROR(
796
1.51k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.51k
    }
798
364
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
364
    return Status::OK();
800
364
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
47.7k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.7k
    RETURN_IF_ERROR(Base::open(state));
793
47.7k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
368k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
320k
        RETURN_IF_ERROR(
796
320k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
320k
    }
798
47.7k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.7k
    return Status::OK();
800
47.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
8
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
8
    RETURN_IF_ERROR(Base::open(state));
793
8
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
144
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
136
        RETURN_IF_ERROR(
796
136
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
136
    }
798
8
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
8
    return Status::OK();
800
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
63.1k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
63.1k
    return _writer->sink(block, eos);
806
63.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.11k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.11k
    return _writer->sink(block, eos);
806
1.11k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
61.9k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.9k
    return _writer->sink(block, eos);
806
61.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
8
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
8
    return _writer->sink(block, eos);
806
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
48.2k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
48.2k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
48.2k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
48.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
48.2k
    if (_writer) {
818
48.2k
        Status st = _writer->get_writer_status();
819
48.2k
        if (exec_status.ok()) {
820
48.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
48.1k
                                                       : Status::Cancelled("force close"));
822
48.1k
        } else {
823
134
            _writer->force_close(exec_status);
824
134
        }
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
48.2k
        RETURN_IF_ERROR(st);
829
48.2k
    }
830
48.1k
    return Base::close(state, exec_status);
831
48.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
353
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
353
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
353
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
353
    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
353
    if (_writer) {
818
353
        Status st = _writer->get_writer_status();
819
353
        if (exec_status.ok()) {
820
353
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
353
                                                       : Status::Cancelled("force close"));
822
353
        } 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
353
        RETURN_IF_ERROR(st);
829
353
    }
830
353
    return Base::close(state, exec_status);
831
353
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
47.8k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.8k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.8k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.8k
    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
47.8k
    if (_writer) {
818
47.8k
        Status st = _writer->get_writer_status();
819
47.8k
        if (exec_status.ok()) {
820
47.7k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.7k
                                                       : Status::Cancelled("force close"));
822
47.7k
        } else {
823
134
            _writer->force_close(exec_status);
824
134
        }
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
47.8k
        RETURN_IF_ERROR(st);
829
47.8k
    }
830
47.7k
    return Base::close(state, exec_status);
831
47.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
8
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
8
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
8
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
8
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
8
    if (_writer) {
818
8
        Status st = _writer->get_writer_status();
819
8
        if (exec_status.ok()) {
820
8
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
8
                                                       : Status::Cancelled("force close"));
822
8
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
8
        RETURN_IF_ERROR(st);
829
8
    }
830
8
    return Base::close(state, exec_status);
831
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
832
833
// An instantiation added outside the macros below needs the matching
834
// 'extern template' declaration in the operator's header (enforced by
835
// build-support/check-extern-template-pairing.py). Instantiations expanded
836
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
837
// skipped -- so their extern pairing has to be kept in sync by hand.
838
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
839
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
840
DECLARE_OPERATOR(ResultSinkLocalState)
841
DECLARE_OPERATOR(JdbcTableSinkLocalState)
842
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
843
DECLARE_OPERATOR(ResultFileSinkLocalState)
844
DECLARE_OPERATOR(OlapTableSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
846
DECLARE_OPERATOR(HiveTableSinkLocalState)
847
DECLARE_OPERATOR(TVFTableSinkLocalState)
848
DECLARE_OPERATOR(IcebergTableSinkLocalState)
849
DECLARE_OPERATOR(PaimonTableSinkLocalState)
850
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
851
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
852
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
853
DECLARE_OPERATOR(MCTableSinkLocalState)
854
DECLARE_OPERATOR(AnalyticSinkLocalState)
855
DECLARE_OPERATOR(BlackholeSinkLocalState)
856
DECLARE_OPERATOR(SortSinkLocalState)
857
DECLARE_OPERATOR(SpillSortSinkLocalState)
858
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
859
DECLARE_OPERATOR(AggSinkLocalState)
860
DECLARE_OPERATOR(BucketedAggSinkLocalState)
861
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
862
DECLARE_OPERATOR(ExchangeSinkLocalState)
863
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
864
DECLARE_OPERATOR(UnionSinkLocalState)
865
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
866
DECLARE_OPERATOR(PartitionSortSinkLocalState)
867
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
868
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
869
DECLARE_OPERATOR(SetSinkLocalState<true>)
870
DECLARE_OPERATOR(SetSinkLocalState<false>)
871
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
872
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
873
DECLARE_OPERATOR(CacheSinkLocalState)
874
DECLARE_OPERATOR(DictSinkLocalState)
875
DECLARE_OPERATOR(RecCTESinkLocalState)
876
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
877
878
#undef DECLARE_OPERATOR
879
880
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
881
DECLARE_OPERATOR(HashJoinProbeLocalState)
882
DECLARE_OPERATOR(OlapScanLocalState)
883
DECLARE_OPERATOR(GroupCommitLocalState)
884
DECLARE_OPERATOR(JDBCScanLocalState)
885
DECLARE_OPERATOR(FileScanLocalState)
886
DECLARE_OPERATOR(AnalyticLocalState)
887
DECLARE_OPERATOR(SortLocalState)
888
DECLARE_OPERATOR(SpillSortLocalState)
889
DECLARE_OPERATOR(LocalMergeSortLocalState)
890
DECLARE_OPERATOR(AggLocalState)
891
DECLARE_OPERATOR(BucketedAggLocalState)
892
DECLARE_OPERATOR(PartitionedAggLocalState)
893
DECLARE_OPERATOR(TableFunctionLocalState)
894
DECLARE_OPERATOR(ExchangeLocalState)
895
DECLARE_OPERATOR(RepeatLocalState)
896
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
897
DECLARE_OPERATOR(AssertNumRowsLocalState)
898
DECLARE_OPERATOR(EmptySetLocalState)
899
DECLARE_OPERATOR(UnionSourceLocalState)
900
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
901
DECLARE_OPERATOR(PartitionSortSourceLocalState)
902
DECLARE_OPERATOR(SetSourceLocalState<true>)
903
DECLARE_OPERATOR(SetSourceLocalState<false>)
904
DECLARE_OPERATOR(DataGenLocalState)
905
DECLARE_OPERATOR(SchemaScanLocalState)
906
DECLARE_OPERATOR(MetaScanLocalState)
907
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
908
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
909
DECLARE_OPERATOR(CacheSourceLocalState)
910
DECLARE_OPERATOR(RecCTESourceLocalState)
911
DECLARE_OPERATOR(RecCTEScanLocalState)
912
913
#ifdef BE_TEST
914
DECLARE_OPERATOR(MockLocalState)
915
DECLARE_OPERATOR(MockScanLocalState)
916
#endif
917
#undef DECLARE_OPERATOR
918
919
template class StreamingOperatorX<AssertNumRowsLocalState>;
920
template class StreamingOperatorX<SelectLocalState>;
921
922
template class StatefulOperatorX<HashJoinProbeLocalState>;
923
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
924
template class StatefulOperatorX<RepeatLocalState>;
925
template class StatefulOperatorX<MaterializationLocalState>;
926
template class StatefulOperatorX<StreamingAggLocalState>;
927
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
928
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
929
template class StatefulOperatorX<TableFunctionLocalState>;
930
931
template class PipelineXSinkLocalState<HashJoinSharedState>;
932
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
933
template class PipelineXSinkLocalState<SortSharedState>;
934
template class PipelineXSinkLocalState<SpillSortSharedState>;
935
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
936
template class PipelineXSinkLocalState<AnalyticSharedState>;
937
template class PipelineXSinkLocalState<AggSharedState>;
938
template class PipelineXSinkLocalState<BucketedAggSharedState>;
939
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
940
template class PipelineXSinkLocalState<FakeSharedState>;
941
template class PipelineXSinkLocalState<UnionSharedState>;
942
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
943
template class PipelineXSinkLocalState<MultiCastSharedState>;
944
template class PipelineXSinkLocalState<SetSharedState>;
945
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
946
template class PipelineXSinkLocalState<BasicSharedState>;
947
template class PipelineXSinkLocalState<DataQueueSharedState>;
948
template class PipelineXSinkLocalState<RecCTESharedState>;
949
950
template class PipelineXLocalState<HashJoinSharedState>;
951
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
952
template class PipelineXLocalState<SortSharedState>;
953
template class PipelineXLocalState<SpillSortSharedState>;
954
template class PipelineXLocalState<NestedLoopJoinSharedState>;
955
template class PipelineXLocalState<AnalyticSharedState>;
956
template class PipelineXLocalState<AggSharedState>;
957
template class PipelineXLocalState<BucketedAggSharedState>;
958
template class PipelineXLocalState<PartitionedAggSharedState>;
959
template class PipelineXLocalState<FakeSharedState>;
960
template class PipelineXLocalState<UnionSharedState>;
961
template class PipelineXLocalState<DataQueueSharedState>;
962
template class PipelineXLocalState<MultiCastSharedState>;
963
template class PipelineXLocalState<PartitionSortNodeSharedState>;
964
template class PipelineXLocalState<SetSharedState>;
965
template class PipelineXLocalState<LocalExchangeSharedState>;
966
template class PipelineXLocalState<BasicSharedState>;
967
template class PipelineXLocalState<RecCTESharedState>;
968
969
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
970
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
971
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
972
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
973
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
974
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
977
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
978
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
979
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
980
981
#ifdef BE_TEST
982
template class OperatorX<DummyOperatorLocalState>;
983
template class DataSinkOperatorX<DummySinkLocalState>;
984
#endif
985
986
} // namespace doris